cmake: fix build against ncurses with separate libtinfo

Tested this on openbsd as well:
https://github.com/robertgzr/musikcube/tree/bsd
https://builds.sr.ht/~robertgzr/job/623049

Signed-off-by: Robert Günzler <r@gnzler.io>
This commit is contained in:
Robert Günzler 2021-10-27 16:39:15 +02:00
parent c40b8d6a30
commit 5bdf0113d7
No known key found for this signature in database
GPG Key ID: 2143BD2AAB94BCC4

View File

@ -104,20 +104,14 @@ else()
find_package(PkgConfig)
if (${NCURSES_DISABLE_LIB_SUFFIXES} MATCHES "true")
# pkg_check_modules fails on some systems, including OpenBSD.
# pkg_check_modules(NCURSES REQUIRED ncurses panel)
ensure_library_exists(ncurses)
ensure_library_exists(panel)
set(NCURSES_LIBRARIES ncurses panel)
pkg_check_modules(NCURSES REQUIRED ncurses panel)
message(STATUS "[ncurses] using library names without 'w' prefix")
else()
# pkg_check_modules fails on some systems, including OpenBSD.
# pkg_check_modules(NCURSES REQUIRED ncursesw panelw)
ensure_library_exists(ncursesw)
ensure_library_exists(panelw)
set(NCURSES_LIBRARIES ncursesw panelw)
pkg_check_modules(NCURSES REQUIRED ncursesw panelw)
message(STATUS "[ncurses] using library names with 'w' prefix")
endif()
target_link_libraries(musikcube ${musikcube_LINK_LIBS} ${NCURSES_LIBRARIES} musikcore)
target_link_libraries(musikcube ${musikcube_LINK_LIBS} ${NCURSES_LINK_LIBRARIES} musikcore)
endif()
if (ENABLE_PCH MATCHES "true")