diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d15cf93b9..f63ab83ee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -317,19 +317,13 @@ jobs: with: fetch-depth: 0 submodules: recursive - - name: Update vcpkg (TEMPORARY) - run: | - cd $env:VCPKG_INSTALLATION_ROOT - git pull - .\bootstrap-vcpkg.bat - shell: pwsh - name: Cache vcpkg dependencies id: cache-deps uses: actions/cache@v3 with: - key: vcpkg-x64-${{ hashFiles('vcpkg.json') }} + key: vcpkg-msvc-x86_64-${{ hashFiles('vcpkg.json') }} restore-keys: | - vcpkg-x64- + vcpkg-msvc-x86_64- path: build\vcpkg_installed - name: Cache ccache data uses: actions/cache@v3 diff --git a/CMakeLists.txt b/CMakeLists.txt index 84089ede3..3c01bebf0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -240,29 +240,28 @@ if(LMMS_BUILD_APPLE) endif() find_package(Perl) -IF(WANT_LV2) - IF(PKG_CONFIG_FOUND) - PKG_CHECK_MODULES(LV2 lv2) - PKG_CHECK_MODULES(LILV lilv-0) - ENDIF() - IF(NOT LV2_FOUND AND NOT LILV_FOUND) - UNSET(LV2_FOUND CACHE) - UNSET(LILV_FOUND CACHE) - FIND_PACKAGE(LV2 CONFIG) - FIND_PACKAGE(LILV CONFIG) - IF(LILV_FOUND) - SET(LILV_LIBRARIES "lilv::lilv") - ENDIF() - ENDIF() - IF(LV2_FOUND AND LILV_FOUND) - SET(LMMS_HAVE_LV2 TRUE) - SET(STATUS_LV2 "OK") - ELSE() - SET(STATUS_LV2 "not found, install it or set PKG_CONFIG_PATH appropriately") - ENDIF() -ELSE(WANT_LV2) - SET(STATUS_LV2 "not built as requested") -ENDIF(WANT_LV2) +if(WANT_LV2) + if(PKG_CONFIG_FOUND) + pkg_check_modules(LV2 lv2) + endif() + + find_package(Lilv) + if(Lilv_FOUND) + set(LILV_LIBRARIES Lilv::lilv) + endif() + + # Ensure both dependencies are found + if(NOT LV2_FOUND) + set(STATUS_LV2 "not found, install lv2 or set PKG_CONFIG_PATH appropriately") + elseif(NOT Lilv_FOUND) + set(STATUS_LV2 "not found, install lilv or set PKG_CONFIG_PATH appropriately") + else() + set(LMMS_HAVE_LV2 TRUE) + set(STATUS_LV2 "OK") + endif() +else() + set(STATUS_LV2 "not built as requested") +endif() IF(WANT_SUIL) IF(PKG_CONFIG_FOUND) diff --git a/cmake/modules/FindFluidSynth.cmake b/cmake/modules/FindFluidSynth.cmake index 70c40b8d8..d83fd31ca 100644 --- a/cmake/modules/FindFluidSynth.cmake +++ b/cmake/modules/FindFluidSynth.cmake @@ -22,7 +22,7 @@ find_path(FluidSynth_INCLUDE_DIR ) find_library(FluidSynth_LIBRARY - NAMES "fluidsynth" + NAMES "fluidsynth" "fluidsynth-3" "fluidsynth-2" "fluidsynth-1" HINTS ${FLUIDSYNTH_PKG_LIBRARY_DIRS} ) diff --git a/cmake/modules/FindLilv.cmake b/cmake/modules/FindLilv.cmake new file mode 100644 index 000000000..d9124de38 --- /dev/null +++ b/cmake/modules/FindLilv.cmake @@ -0,0 +1,19 @@ +# Copyright (c) 2025 Dalton Messmer +# +# Redistribution and use is allowed according to the terms of the New BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +include(ImportedTargetHelpers) + +find_package_config_mode_with_fallback(Lilv Lilv::lilv + LIBRARY_NAMES "lilv" "lilv-0" + INCLUDE_NAMES "lilv/lilv.h" + PKG_CONFIG "lilv-0" +) + +include(FindPackageHandleStandardArgs) + +find_package_handle_standard_args(Lilv + REQUIRED_VARS Lilv_LIBRARY Lilv_INCLUDE_DIRS + VERSION_VAR Lilv_VERSION +) diff --git a/plugins/Lv2Effect/CMakeLists.txt b/plugins/Lv2Effect/CMakeLists.txt index e0427eaa3..ca5658172 100644 --- a/plugins/Lv2Effect/CMakeLists.txt +++ b/plugins/Lv2Effect/CMakeLists.txt @@ -1,6 +1,6 @@ IF(LMMS_HAVE_LV2) include_directories(SYSTEM ${LV2_INCLUDE_DIRS}) - include_directories(SYSTEM ${LILV_INCLUDE_DIRS}) + include_directories(SYSTEM ${Lilv_INCLUDE_DIRS}) include_directories(SYSTEM ${SUIL_INCLUDE_DIRS}) INCLUDE(BuildPlugin) BUILD_PLUGIN(lv2effect Lv2Effect.cpp Lv2FxControls.cpp Lv2FxControlDialog.cpp Lv2Effect.h Lv2FxControls.h Lv2FxControlDialog.h diff --git a/plugins/Lv2Instrument/CMakeLists.txt b/plugins/Lv2Instrument/CMakeLists.txt index e10eff692..a316a0fa7 100644 --- a/plugins/Lv2Instrument/CMakeLists.txt +++ b/plugins/Lv2Instrument/CMakeLists.txt @@ -1,6 +1,6 @@ IF(LMMS_HAVE_LV2) include_directories(SYSTEM ${LV2_INCLUDE_DIRS}) - include_directories(SYSTEM ${LILV_INCLUDE_DIRS}) + include_directories(SYSTEM ${Lilv_INCLUDE_DIRS}) include_directories(SYSTEM ${SUIL_INCLUDE_DIRS}) INCLUDE(BuildPlugin) BUILD_PLUGIN(lv2instrument Lv2Instrument.cpp Lv2Instrument.h MOCFILES Lv2Instrument.h EMBEDDED_RESOURCES logo.png) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 55f416fae..9612190bf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -60,19 +60,19 @@ include_directories(SYSTEM ${FFTW3F_INCLUDE_DIRS} ) -IF(NOT ("${PULSEAUDIO_INCLUDE_DIR}" STREQUAL "")) +IF(PULSEAUDIO_INCLUDE_DIR) include_directories(SYSTEM "${PULSEAUDIO_INCLUDE_DIR}") ENDIF() -IF(NOT ("${LV2_INCLUDE_DIRS}" STREQUAL "")) +IF(LV2_INCLUDE_DIRS) include_directories(SYSTEM ${LV2_INCLUDE_DIRS}) ENDIF() -IF(NOT ("${LILV_INCLUDE_DIRS}" STREQUAL "")) - include_directories(SYSTEM ${LILV_INCLUDE_DIRS}) +IF(Lilv_INCLUDE_DIRS) + include_directories(SYSTEM ${Lilv_INCLUDE_DIRS}) ENDIF() -IF(NOT ("${SUIL_INCLUDE_DIRS}" STREQUAL "")) +IF(SUIL_INCLUDE_DIRS) include_directories(SYSTEM ${SUIL_INCLUDE_DIRS}) ENDIF()