Add back option to use system taglib, add warning at the bottom

This commit is contained in:
Jonas Kvinge
2020-07-07 23:44:04 +02:00
parent 4e003c12a6
commit 904097b7b1
5 changed files with 90 additions and 55 deletions

View File

@@ -193,13 +193,28 @@ if(X11_FOUND)
endif(X11_FOUND)
# TAGLIB
set(TAGLIB_INCLUDE_DIRS "${CMAKE_BINARY_DIR}/3rdparty/taglib/headers/taglib/;${CMAKE_BINARY_DIR}/3rdparty/taglib/headers/")
set(TAGLIB_LIBRARY_DIRS "")
set(TAGLIB_LIBRARIES tag)
add_subdirectory(3rdparty/utf8-cpp)
add_subdirectory(3rdparty/taglib)
set(HAVE_TAGLIB_DSFFILE ON)
add_definitions(-DTAGLIB_STATIC)
option(USE_SYSTEM_TAGLIB "Use system taglib" OFF)
if(USE_SYSTEM_TAGLIB)
pkg_check_modules(TAGLIB REQUIRED taglib>=1.11.1)
message(WARNING "Using system taglib library.")
find_path(HAVE_TAGLIB_DSFFILE_H taglib/dsffile.h)
find_path(HAVE_TAGLIB_DSDIFFFILE_H taglib/dsdifffile.h)
if(HAVE_TAGLIB_DSFFILE_H)
set(HAVE_TAGLIB_DSFFILE ON)
endif(HAVE_TAGLIB_DSFFILE_H)
if(HAVE_TAGLIB_DSDIFFFILE_H)
set(HAVE_TAGLIB_DSDIFFFILE ON)
endif(HAVE_TAGLIB_DSDIFFFILE_H)
else(USE_SYSTEM_TAGLIB)
set(TAGLIB_INCLUDE_DIRS "${CMAKE_BINARY_DIR}/3rdparty/taglib/headers/taglib/;${CMAKE_BINARY_DIR}/3rdparty/taglib/headers/")
set(TAGLIB_LIBRARY_DIRS "")
set(TAGLIB_LIBRARIES tag)
add_subdirectory(3rdparty/utf8-cpp)
add_subdirectory(3rdparty/taglib)
set(HAVE_TAGLIB_DSFFILE ON)
set(HAVE_TAGLIB_DSDIFFFILE ON)
add_definitions(-DTAGLIB_STATIC)
endif(USE_SYSTEM_TAGLIB)
# SingleApplication
add_subdirectory(3rdparty/singleapplication)
@@ -388,9 +403,9 @@ option(BUILD_TAGLIB_TESTS "Build the test suite" OFF)
if(BUILD_TESTS)
add_subdirectory(tests)
endif(BUILD_TESTS)
if(BUILD_TAGLIB_TESTS)
if(NOT USE_SYSTEM_TAGLIB AND BUILD_TAGLIB_TESTS)
add_subdirectory(tests/taglib)
endif(BUILD_TAGLIB_TESTS)
endif(NOT USE_SYSTEM_TAGLIB AND BUILD_TAGLIB_TESTS)
# Uninstall support
configure_file(
@@ -412,3 +427,7 @@ endif()
if(NOT SQLITE3_FTS5 AND NOT CMAKE_CROSSCOMPILING)
message(WARNING "sqlite3 must be enabled with FTS5. See: https://www.sqlite.org/fts5.html")
endif()
if(USE_SYSTEM_TAGLIB AND NOT TAGLIB_VERSION VERSION_GREATER 1.11.2)
message(WARNING "Using system taglib library. There is a critical bug in the current latest version of TagLib (1.11.1) that can corrupt Ogg files, make sure your systems version has been patched, see: https://github.com/taglib/taglib/issues/864, TagLib upstream is currently not maintained. Do not set USE_SYSTEM_TAGLIB unless you are prepared keep the TagLib in your system up to date with critical fixes.")
endif()