diff --git a/CMakeLists.txt b/CMakeLists.txt index 9825945542..074091453d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -266,25 +266,19 @@ if(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) -if(NOT USE_TAGLIB AND NOT USE_TAGPARSER) - set(USE_TAGLIB ON) -endif() - # TAGLIB if(USE_TAGLIB) - pkg_check_modules(TAGLIB REQUIRED taglib>=1.11.1) - if(TAGLIB_FOUND) - 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) + find_package(TagLib 2.0) + if(TARGET TagLib::TagLib) + set(TAGLIB_FOUND ON) + set(TAGLIB_LIBRARIES TagLib::TagLib) + set(HAVE_TAGLIB_DSFFILE ON) + set(HAVE_TAGLIB_DSDIFFFILE ON) + else() + pkg_check_modules(TAGLIB REQUIRED taglib>=1.11.1) endif() endif()