diff --git a/.gitignore b/.gitignore index f787b57ce..8faabcd4b 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,8 @@ src/3rdparty/obj src/contrib src/core/obj src/plugins/oggdecoder/obj +src/plugins/server/libmicrohttpd-prefix +src/plugins/server/microhttpd src/plugins/waveout/obj src/plugins/taglib_plugin/obj src/plugins/taglib_plugin/taglib-1.11 diff --git a/src/plugins/server/CMakeLists.txt b/src/plugins/server/CMakeLists.txt index df738fd2d..9d2cb6596 100644 --- a/src/plugins/server/CMakeLists.txt +++ b/src/plugins/server/CMakeLists.txt @@ -4,36 +4,47 @@ set (server_SOURCES Transcoder.cpp TranscodingDataStream.cpp Util.cpp - WebSocketServer.cpp -) + WebSocketServer.cpp) set (BOOST_LIBS system filesystem - thread -) + thread) find_package(Boost 1.55.0 REQUIRED ${BOOST_LIBS}) - add_definitions (-DHAVE_BOOST -D_FILE_OFFSET_BITS=64) set (BOOST_LINK_LIBS ${Boost_LIBRARIES}) -#message(STATUS "boost libs: " ${BOOST_LINK_LIBS}) -#message(STATUS "boost includes: " ${Boost_INCLUDE_DIRS}) +add_library(server SHARED ${server_SOURCES}) set (server_LINK_LIBS ${BOOST_LINK_LIBS}) -include_directories ( - "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/include" -) +include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/include") -add_library(server SHARED ${server_SOURCES}) -# prefer static libraries on mac to make redist easier -if (${LINK_STATICALLY} MATCHES "true") +if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + # the version of libmicrohttpd that ships with FreeBSD hangs during shutdown, + # but newer versions is fine. snag the sources and compile them on-demand. + include (ExternalProject) + + ExternalProject_Add(libmicrohttpd + URL https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-0.9.58.tar.gz + BUILD_IN_SOURCE 1 + CONFIGURE_COMMAND ./configure --enable-https=no --disable-curl --prefix=${CMAKE_CURRENT_SOURCE_DIR}/microhttpd/ + BUILD_COMMAND make + INSTALL_COMMAND make install + TEST_COMMAND "") + + add_dependencies(server libmicrohttpd) + + include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/microhttpd/include") + file(GLOB OBJS "${CMAKE_CURRENT_SOURCE_DIR}/libmicrohttpd-prefix/src/libmicrohttpd/src/microhttpd/.libs/*.o") + + target_link_libraries(server ${server_LINK_LIBS} "${OBJS}" z) +elseif (${LINK_STATICALLY} MATCHES "true") + # prefer static libraries on mac to make redist easier find_library(MICROHTTPDLIB NAMES libmicrohttpd.a microhttpd) - find_library(MP3LAMELIB NAMES libmp3lame.a mp3lame) - target_link_libraries(server ${server_LINK_LIBS} ${MICROHTTPDLIB} ${MP3LAMELIB} z) + target_link_libraries(server ${server_LINK_LIBS} ${MICROHTTPDLIB} z) else() - target_link_libraries(server ${server_LINK_LIBS} microhttpd mp3lame z) + target_link_libraries(server ${server_LINK_LIBS} microhttpd z) endif()