Fixed USE_BUNDLED_TAGLIB=false, and renamed to ENABLE_BUNDLED_TAGLIB

This commit is contained in:
casey langen 2021-04-09 22:43:56 -07:00
parent 1539a407db
commit 15134e9a80
2 changed files with 25 additions and 20 deletions

View File

@ -62,6 +62,17 @@ if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB)
endif()
endif()
# we default to using 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 important bugfixes.
if (NOT DEFINED ENABLE_BUNDLED_TAGLIB)
message(STATUS "[build] ENABLE_BUNDLED_TAGLIB not defined, setting to 'true'")
set(ENABLE_BUNDLED_TAGLIB "true")
else()
message(STATUS "[build] ENABLE_BUNDLED_TAGLIB specified as '${ENABLE_BUNDLED_TAGLIB}'")
endif()
message(STATUS "[build] link libraries are: ${musikcube_LINK_LIBS}")
include_directories (
@ -95,11 +106,6 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "OpenBSD
add_definitions (-DNO_NCURSESW)
endif()
# 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
# important bugfixes.
set(USE_BUNDLED_TAGLIB "true")
add_subdirectory(src/musikcore)
add_subdirectory(src/core_c_demo)
add_subdirectory(src/musikcube)
@ -305,7 +311,7 @@ if (GENERATE_DEB MATCHES "1")
set(DEPENDENCIES "${DEPENDENCIES}, libavcodec-extra, libavutil${DEB_AVUTIL_VERSION}, libavformat${DEB_AVFORMAT_VERSION}, libswresample${DEB_SWRESAMPLE_VERSION}")
endif()
if (NOT ${USE_BUNDLED_TAGLIB} MATCHES "true")
if (${ENABLE_BUNDLED_TAGLIB} MATCHES "false")
set(DEPENDENCIES "${DEPENDENCIES}, libtag1v5")
endif()

View File

@ -11,26 +11,25 @@ else()
endif()
add_library(taglibreader SHARED ${taglibreader_SOURCES})
if (NOT ${ENABLE_BUNDLED_TAGLIB} MATCHES "false")
message(STATUS "[taglibmetadatareader] using bundled taglib = true")
message(STATUS "[taglibmetadatareader] using bundled taglib = ${USE_BUNDLED_TAGLIB}")
include(ExternalProject)
if (${USE_BUNDLED_TAGLIB} MATCHES "true")
if (${USE_BUNDLED_TAGLIB} MATCHES "true")
include(ExternalProject)
ExternalProject_Add(taglib
SOURCE_DIR "${musikcube_SOURCE_DIR}/src/plugins/taglib_plugin/taglib-1.11"
BUILD_IN_SOURCE 0
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX:PATH=${musikcube_SOURCE_DIR}/src/plugins/taglib_plugin/taglib-1.11/stage/"
INSTALL_COMMAND make install)
ExternalProject_Add(taglib
SOURCE_DIR "${musikcube_SOURCE_DIR}/src/plugins/taglib_plugin/taglib-1.11"
BUILD_IN_SOURCE 0
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX:PATH=${musikcube_SOURCE_DIR}/src/plugins/taglib_plugin/taglib-1.11/stage/"
INSTALL_COMMAND make install)
include_directories("${musikcube_SOURCE_DIR}/src/plugins/taglib_plugin/taglib-1.11/stage/include")
endif()
include_directories("${musikcube_SOURCE_DIR}/src/plugins/taglib_plugin/taglib-1.11/stage/include")
add_dependencies(taglibreader taglib)
target_link_libraries(taglibreader ${BOOST_LINK_LIBS} "${musikcube_SOURCE_DIR}/src/plugins/taglib_plugin/taglib-1.11/stage/lib/libtag.a" z)
message(STATUS "[taglibmetadatareader] using ${musikcube_SOURCE_DIR}/src/plugins/taglib_plugin/taglib-1.11/stage/lib/libtag.a")
else()
message(STATUS "[taglibmetadatareader] using bundled taglib = false")
target_link_libraries(taglibreader ${BOOST_LINK_LIBS} tag z)
endif()