buildsystem: use taglib 2's CMake support

This commit is contained in:
Gary Wang 2024-10-16 00:47:29 +08:00
parent 5092f9bafc
commit 64c75263bf
No known key found for this signature in database
GPG Key ID: 5D30A4F15EA78760
3 changed files with 2 additions and 11 deletions

View File

@ -45,9 +45,6 @@ jobs:
git clone -q https://invent.kde.org/frameworks/kcodecs.git dependencies_src/kcodecs git clone -q https://invent.kde.org/frameworks/kcodecs.git dependencies_src/kcodecs
cmake .\dependencies_src\kcodecs -Bbuild_dependencies/kcodecs -DCMAKE_INSTALL_PREFIX="dependencies_bin" -DBUILD_TESTING=OFF || goto :error cmake .\dependencies_src\kcodecs -Bbuild_dependencies/kcodecs -DCMAKE_INSTALL_PREFIX="dependencies_bin" -DBUILD_TESTING=OFF || goto :error
cmake --build build_dependencies/kcodecs --config Release --target=install || goto :error cmake --build build_dependencies/kcodecs --config Release --target=install || goto :error
:: ===== pkg-config =====
choco install pkgconfiglite
set PKG_CONFIG_PATH=%PWD%/dependencies_bin/lib/pkgconfig
:: ===== taglib ===== :: ===== taglib =====
git clone --recurse-submodules -q https://github.com/taglib/taglib.git dependencies_src/taglib git clone --recurse-submodules -q https://github.com/taglib/taglib.git dependencies_src/taglib
cmake .\dependencies_src\taglib -Bbuild_dependencies/taglib -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX="dependencies_bin" || goto :error cmake .\dependencies_src\taglib -Bbuild_dependencies/taglib -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX="dependencies_bin" || goto :error

View File

@ -17,17 +17,13 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
option(USE_QTEXTCODEC "Use QTextCodec instead of QStringConverter, in case Qt is not built with ICU" OFF) option(USE_QTEXTCODEC "Use QTextCodec instead of QStringConverter, in case Qt is not built with ICU" OFF)
find_package(Qt6 6.6 COMPONENTS Widgets Multimedia Network LinguistTools REQUIRED) find_package(Qt6 6.6 COMPONENTS Widgets Multimedia Network LinguistTools REQUIRED)
find_package(TagLib 2.0.0)
find_package(KF6Codecs 6.1.0) find_package(KF6Codecs 6.1.0)
find_package(PkgConfig)
if (USE_QTEXTCODEC) if (USE_QTEXTCODEC)
find_package(Qt6 6.6 COMPONENTS Core5Compat REQUIRED) find_package(Qt6 6.6 COMPONENTS Core5Compat REQUIRED)
endif() endif()
if (PKG_CONFIG_FOUND)
pkg_check_modules(TagLib taglib IMPORTED_TARGET)
endif ()
set (PMUSIC_CPP_FILES set (PMUSIC_CPP_FILES
main.cpp main.cpp
mainwindow.cpp mainwindow.cpp
@ -76,7 +72,7 @@ endif ()
if (NOT TagLib_FOUND) if (NOT TagLib_FOUND)
target_compile_definitions(${EXE_NAME} PRIVATE NO_TAGLIB=1) target_compile_definitions(${EXE_NAME} PRIVATE NO_TAGLIB=1)
else () else ()
target_link_libraries(${EXE_NAME} PRIVATE PkgConfig::TagLib) target_link_libraries(${EXE_NAME} PRIVATE TagLib::tag)
endif () endif ()
if (TARGET KF6::Codecs) if (TARGET KF6::Codecs)

View File

@ -3,7 +3,6 @@ image:
environment: environment:
CMAKE_INSTALL_ROOT: C:\projects\cmake CMAKE_INSTALL_ROOT: C:\projects\cmake
PACKAGE_INSTALL_ROOT: C:\projects\pir PACKAGE_INSTALL_ROOT: C:\projects\pir
PKG_CONFIG_PATH: C:\projects\pir\lib\pkgconfig
matrix: matrix:
- build_name: mingw1120_64_qt6_7 - build_name: mingw1120_64_qt6_7
QTPATH: C:\Qt\6.7\mingw_64 QTPATH: C:\Qt\6.7\mingw_64
@ -23,7 +22,6 @@ build_script:
- mkdir 3rdparty - mkdir 3rdparty
- choco install ninja - choco install ninja
- choco install gperf - choco install gperf
- choco install pkgconfiglite
- cd 3rdparty - cd 3rdparty
# install ECM # install ECM
- git clone -q https://invent.kde.org/frameworks/extra-cmake-modules.git - git clone -q https://invent.kde.org/frameworks/extra-cmake-modules.git