diff --git a/.cmake/ConfigureStaticLinking.cmake b/.cmake/ConfigureStaticPaths.cmake similarity index 77% rename from .cmake/ConfigureStaticLinking.cmake rename to .cmake/ConfigureStaticPaths.cmake index 050affa7a..3e0e9c85c 100644 --- a/.cmake/ConfigureStaticLinking.cmake +++ b/.cmake/ConfigureStaticPaths.cmake @@ -9,19 +9,10 @@ if (${LINK_STATICALLY} MATCHES "true") set(Boost_USE_STATIC_LIBS ON) include_directories("${CMAKE_CURRENT_SOURCE_DIR}/vendor/ffmpeg-bin/include") - link_directories("${CMAKE_CURRENT_SOURCE_DIR}/vendor/ffmpeg-bin/lib") - include_directories("${CMAKE_CURRENT_SOURCE_DIR}/vendor/lame-bin/include") - link_directories("${CMAKE_CURRENT_SOURCE_DIR}/vendor/lame-bin/lib") - include_directories("${CMAKE_CURRENT_SOURCE_DIR}/vendor/libmicrohttpd-bin/include") - link_directories("${CMAKE_CURRENT_SOURCE_DIR}/vendor/libmicrohttpd-bin/lib") - include_directories("${CMAKE_CURRENT_SOURCE_DIR}/vendor/zlib-bin/include") - link_directories("${CMAKE_CURRENT_SOURCE_DIR}/vendor/zlib-bin/lib") - include_directories("${CMAKE_CURRENT_SOURCE_DIR}/vendor/curl-bin/include") - link_directories("${CMAKE_CURRENT_SOURCE_DIR}/vendor/curl-bin/lib") list( APPEND diff --git a/CMakeLists.txt b/CMakeLists.txt index 29cf38e6a..215275bf0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,12 +18,12 @@ include(CMakeToolsHelpers OPTIONAL) include(CheckDependencies) include(CheckAtomic) include(ConfigureRpath) -include(AddDarwinSystemLibs) +include(ConfigureStaticPaths) # highest priority lib paths include(ConfigureBsdPaths) +include(AddDarwinSystemLibs) include(ConfigureCurses) include(ConfigureTaglib) include(ConfigureCompilerFlags) -include(ConfigureStaticLinking) message(STATUS "[vendor-link-directories] ${VENDOR_LINK_DIRECTORIES}") @@ -70,12 +70,12 @@ endif() message(STATUS "[build] musikcube_LINK_LIBS: " ${musikcube_LINK_LIBS}) add_subdirectory(src/musikcore) -#add_subdirectory(src/core_c_demo) +add_subdirectory(src/core_c_demo) add_subdirectory(src/musikcube) add_subdirectory(src/musikcubed) add_subdirectory(src/plugins/taglib_plugin) add_subdirectory(src/plugins/nullout) -#add_subdirectory(src/plugins/server) +add_subdirectory(src/plugins/server) add_subdirectory(src/plugins/httpdatastream) add_subdirectory(src/plugins/stockencoders) add_subdirectory(src/plugins/supereqdsp) diff --git a/src/plugins/server/CMakeLists.txt b/src/plugins/server/CMakeLists.txt index 8b6cc8cc3..40c609fa3 100644 --- a/src/plugins/server/CMakeLists.txt +++ b/src/plugins/server/CMakeLists.txt @@ -16,14 +16,19 @@ include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/include") include_directories(${Boost_INCLUDE_DIRS}) if (${LINK_STATICALLY} MATCHES "true") - find_library(LIBMICROHTTPD NAMES libmicrohttpd.a) - find_library(LIBZ NAMES libz.a) - target_link_libraries(server ${server_LINK_LIBS} ${LIBZ} ${LIBMICROHTTPD}) + # unclear why NO_DEFAULT_PATH NO_CACHE is required; we want to use our vendor'd version, + # but without NO_CACHE we always get the brew one. other deps are fine. + find_library(LIBMICROHTTPD NAMES libmicrohttpd.a PATHS ${VENDOR_LINK_DIRECTORIES} NO_DEFAULT_PATH NO_CACHE) + find_library(LIBZ NAMES libz.a PATHS ${VENDOR_LINK_DIRECTORIES}) else() - ensure_library_exists(microhttpd) - set(EXTRA_LIBS "") - if (CMAKE_SYSTEM_NAME MATCHES "Darwin") - set(EXTRA_LIBS "gnutls") + if (APPLE) + find_library(LIBGNUTLS NAMES gnuatls) + set(EXTRA_LIBS "${LIBGNUTLS}") endif() - target_link_libraries(server ${server_LINK_LIBS} microhttpd z ${EXTRA_LIBS}) + find_library(LIBMICROHTTPD NAMES microhttpd) + find_library(LIBZ NAMES z) endif() + +message(STATUS "[server] using " ${LIBMICROHTTPD} ", " ${LIBZ}) + +target_link_libraries(server ${server_LINK_LIBS} ${LIBZ} ${LIBMICROHTTPD} ${EXTRA_LIBS})