diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d4cf88..e19ebbe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,8 @@ if (VCPKG_TOOLCHAIN) endif() option(VCPKG_LIBSNDFILE "Import libsndfile from vcpkg" OFF) +else() + set(VCPKG_MANIFEST_FEATURES) endif() list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 0960f77..b356c97 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -65,7 +65,12 @@ if(NOT WIN32 AND NOT APPLE) determine_package_config_dependency(ZMUSIC_PACKAGE_DEPENDENCIES TARGET Threads::Threads MODULE Threads) endif() -option(DYN_SNDFILE "Dynamically load libsndfile" ON) +if ("vcpkg-libsndfile" IN_LIST VCPKG_MANIFEST_FEATURES) + set(DYN_SNDFILE 0) +else() + option(DYN_SNDFILE "Dynamically load libsndfile" ON) +endif() + if(DYN_SNDFILE) target_compile_definitions(zmusic-obj INTERFACE HAVE_SNDFILE DYN_SNDFILE) else() @@ -78,7 +83,11 @@ else() endif() endif() -option(DYN_MPG123 "Dynamically load libmpg123" ON) +if ("vcpkg-libsndfile" IN_LIST VCPKG_MANIFEST_FEATURES) + set(DYN_MPG123 0) +else() + option(DYN_MPG123 "Dynamically load libmpg123" ON) +endif() if(DYN_MPG123) target_compile_definitions(zmusic-obj INTERFACE HAVE_MPG123 DYN_MPG123) else()