CMakeLists: Find TagLib using CMake

This commit is contained in:
Jonas Kvinge 2024-01-24 21:30:10 +01:00
parent a915e62e2c
commit 920bb04b00
1 changed files with 9 additions and 15 deletions

View File

@ -266,25 +266,19 @@ if(X11_FOUND)
endif(X11_FOUND) endif(X11_FOUND)
option(USE_TAGLIB "Build with TagLib" OFF) option(USE_TAGLIB "Build with TagLib" ON)
option(USE_TAGPARSER "Build with TagParser" OFF) option(USE_TAGPARSER "Build with TagParser" OFF)
if(NOT USE_TAGLIB AND NOT USE_TAGPARSER)
set(USE_TAGLIB ON)
endif()
# TAGLIB # TAGLIB
if(USE_TAGLIB) if(USE_TAGLIB)
pkg_check_modules(TAGLIB REQUIRED taglib>=1.11.1) find_package(TagLib 2.0)
if(TAGLIB_FOUND) if(TARGET TagLib::TagLib)
find_path(HAVE_TAGLIB_DSFFILE_H taglib/dsffile.h) set(TAGLIB_FOUND ON)
find_path(HAVE_TAGLIB_DSDIFFFILE_H taglib/dsdifffile.h) set(TAGLIB_LIBRARIES TagLib::TagLib)
if(HAVE_TAGLIB_DSFFILE_H) set(HAVE_TAGLIB_DSFFILE ON)
set(HAVE_TAGLIB_DSFFILE ON) set(HAVE_TAGLIB_DSDIFFFILE ON)
endif(HAVE_TAGLIB_DSFFILE_H) else()
if(HAVE_TAGLIB_DSDIFFFILE_H) pkg_check_modules(TAGLIB REQUIRED taglib>=1.11.1)
set(HAVE_TAGLIB_DSDIFFFILE ON)
endif(HAVE_TAGLIB_DSDIFFFILE_H)
endif() endif()
endif() endif()