Changes to actually link against the included taglib on Linux if there's

already a system version installed.
This commit is contained in:
casey langen 2020-06-30 22:42:56 -07:00
parent c1ea922e03
commit 91ea1e384c
3 changed files with 41 additions and 37 deletions

View File

@ -92,39 +92,6 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "OpenBSD
add_definitions (-DNO_NCURSESW) add_definitions (-DNO_NCURSESW)
endif() endif()
add_subdirectory(src/core)
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/httpdatastream)
add_subdirectory(src/plugins/stockencoders)
add_subdirectory(src/plugins/supereqdsp)
add_subdirectory(src/plugins/gmedecoder)
find_library(LIBOPENMPT NAMES openmpt)
if ("${LIBOPENMPT}" STREQUAL "LIBOPENMPT-NOTFOUND")
message(STATUS "[libopenmpt] *not* found! plugin will not be built.")
else()
message(STATUS "[libopenmpt] enabled = true; found library at ${LIBOPENMPT}")
add_subdirectory(src/plugins/libopenmptdecoder)
endif()
if (${FFMPEG_ENABLED} MATCHES "false")
message(STATUS "[ffmpeg] enabled = false")
add_subdirectory(src/plugins/m4adecoder)
add_subdirectory(src/plugins/oggdecoder)
add_subdirectory(src/plugins/nomaddecoder)
add_subdirectory(src/plugins/flacdecoder)
add_dependencies(musikcube m4adecoder oggdecoder nomaddecoder flacdecoder)
else()
message(STATUS "[ffmpeg] enabled = true")
add_subdirectory(src/plugins/ffmpegdecoder)
add_dependencies(musikcube ffmpegdecoder)
endif()
# we use a bundled version of taglib because the latest release is from 2016, # we use a bundled version of taglib because the latest release is from 2016,
# and the upstream git repo is hundreds of commits ahead and has a number of # and the upstream git repo is hundreds of commits ahead and has a number of
# important bugfixes. # important bugfixes.
@ -165,12 +132,47 @@ if (${USE_BUNDLED_TAGLIB} MATCHES "true")
INSTALL_COMMAND make install) INSTALL_COMMAND make install)
include_directories("${musikcube_SOURCE_DIR}/src/plugins/taglib_plugin/taglib-1.11/stage/include") include_directories("${musikcube_SOURCE_DIR}/src/plugins/taglib_plugin/taglib-1.11/stage/include")
link_directories("${musikcube_SOURCE_DIR}/src/plugins/taglib_plugin/taglib-1.11/stage/lib")
add_dependencies(taglibreader taglib)
endif() endif()
# end gross taglib detection stuff # end gross taglib detection stuff
add_subdirectory(src/core)
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/httpdatastream)
add_subdirectory(src/plugins/stockencoders)
add_subdirectory(src/plugins/supereqdsp)
add_subdirectory(src/plugins/gmedecoder)
if (${USE_BUNDLED_TAGLIB} MATCHES "true")
add_dependencies(taglibreader taglib)
endif()
find_library(LIBOPENMPT NAMES openmpt)
if ("${LIBOPENMPT}" STREQUAL "LIBOPENMPT-NOTFOUND")
message(STATUS "[libopenmpt] *not* found! plugin will not be built.")
else()
message(STATUS "[libopenmpt] enabled = true; found library at ${LIBOPENMPT}")
add_subdirectory(src/plugins/libopenmptdecoder)
endif()
if (${FFMPEG_ENABLED} MATCHES "false")
message(STATUS "[ffmpeg] enabled = false")
add_subdirectory(src/plugins/m4adecoder)
add_subdirectory(src/plugins/oggdecoder)
add_subdirectory(src/plugins/nomaddecoder)
add_subdirectory(src/plugins/flacdecoder)
add_dependencies(musikcube m4adecoder oggdecoder nomaddecoder flacdecoder)
else()
message(STATUS "[ffmpeg] enabled = true")
add_subdirectory(src/plugins/ffmpegdecoder)
add_dependencies(musikcube ffmpegdecoder)
endif()
# systemd / MPRIS detection # systemd / MPRIS detection
if (NOT ENABLE_MPRIS MATCHES "false") if (NOT ENABLE_MPRIS MATCHES "false")

View File

@ -14,7 +14,8 @@ endif()
add_library(taglibreader SHARED ${taglibreader_SOURCES}) add_library(taglibreader SHARED ${taglibreader_SOURCES})
if (${USE_BUNDLED_TAGLIB} MATCHES "true") if (${USE_BUNDLED_TAGLIB} MATCHES "true")
target_link_libraries(taglibreader ${BOOST_LINK_LIBS} tag.a z) message(STATUS "[taglibmetadatareader] using ${musikcube_SOURCE_DIR}/src/plugins/taglib_plugin/taglib-1.11/stage/lib/libtag.a")
target_link_libraries(taglibreader ${BOOST_LINK_LIBS} "${musikcube_SOURCE_DIR}/src/plugins/taglib_plugin/taglib-1.11/stage/lib/libtag.a" z)
else() else()
target_link_libraries(taglibreader ${BOOST_LINK_LIBS} tag z) target_link_libraries(taglibreader ${BOOST_LINK_LIBS} tag z)
endif() endif()

View File

@ -336,6 +336,7 @@ set(tag_LIB_SRCS
tagutils.cpp tagutils.cpp
) )
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_library(tag ${tag_LIB_SRCS} ${tag_HDRS}) add_library(tag ${tag_LIB_SRCS} ${tag_HDRS})
if(HAVE_ZLIB AND NOT HAVE_ZLIB_SOURCE) if(HAVE_ZLIB AND NOT HAVE_ZLIB_SOURCE)