From 1f30a92b63196c1632589542cbf2e9b59ad23718 Mon Sep 17 00:00:00 2001 From: casey langen Date: Thu, 10 Feb 2022 23:10:49 -0800 Subject: [PATCH] Statically link against ncurses on Darwin. --- src/musikcube/CMakeLists.txt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/musikcube/CMakeLists.txt b/src/musikcube/CMakeLists.txt index 1bc2f5cb2..66d39fdc6 100644 --- a/src/musikcube/CMakeLists.txt +++ b/src/musikcube/CMakeLists.txt @@ -91,16 +91,21 @@ else() set(PANEL_LIBRARY_NAME panelw) endif() +if (APPLE) + message(STATUS "[ncurses] detected Darwin, linking statically") + set(CURSES_LIBRARY_NAME "lib${CURSES_LIBRARY_NAME}.a") + set(PANEL_LIBRARY_NAME "lib${PANEL_LIBRARY_NAME}.a") +else() + message(STATUS "[ncurses] not Darwin! will attempt to link against libtinfo") + find_library(LIBTINFO NAMES tinfo) + message(STATUS "[musikcube] using libtinfo at: " ${LIBTINFO}) +endif() + find_library(LIBNCURSES NAMES ${CURSES_LIBRARY_NAME} PATHS ${VENDOR_LINK_DIRECTORIES}) find_library(LIBPANEL NAMES ${PANEL_LIBRARY_NAME} PATHS ${VENDOR_LINK_DIRECTORIES}) -if (NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") - find_library(LIBTINFO NAMES tinfo) -endif() - message(STATUS "[musikcube] using libncurses at: " ${LIBNCURSES}) message(STATUS "[musikcube] using libpanel at: " ${LIBPANEL}) -message(STATUS "[musikcube] using libpanel at: " ${LIBTINFO}) target_link_libraries(musikcube ${musikcube_LINK_LIBS} ${LIBNCURSES} ${LIBPANEL} ${LIBTINFO} musikcore) if (ENABLE_PCH MATCHES "true")