vcpkg/ports/libsndfile/portfile.cmake
2022-12-29 23:52:00 -08:00

58 lines
1.6 KiB
CMake

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libsndfile/libsndfile
REF 1.2.0
SHA512 58d2567a4eb67f9af7a472ae02f62ce64bb6f54687bf670c84335a4d1c194d3e8d6933089ae9e2603137a035155447df4b0f59c054731d74d9814c1b757c833a
HEAD_REF master
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
vcpkg_find_acquire_program(PYTHON3)
endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
external-libs ENABLE_EXTERNAL_LIBS
mpeg ENABLE_MPEG
regtest BUILD_REGTEST
)
if(VCPKG_TARGET_IS_UWP)
set(VCPKG_C_FLAGS "/sdl- ${VCPKG_C_FLAGS}")
set(VCPKG_CXX_FLAGS "/sdl- ${VCPKG_CXX_FLAGS}")
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_EXAMPLES=OFF
-DBUILD_TESTING=OFF
-DENABLE_BOW_DOCS=OFF
-DBUILD_PROGRAMS=OFF
-DBUILD_REGTEST=OFF
-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON
-DPYTHON_EXECUTABLE=${PYTHON3}
${FEATURE_OPTIONS}
MAYBE_UNUSED_VARIABLES
PYTHON_EXECUTABLE
)
vcpkg_cmake_install()
if(WIN32 AND (NOT MINGW) AND (NOT CYGWIN))
set(CONFIG_PATH cmake)
else()
set(CONFIG_PATH lib/cmake/SndFile)
endif()
vcpkg_cmake_config_fixup(PACKAGE_NAME SndFile CONFIG_PATH "${CONFIG_PATH}")
vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m)
vcpkg_copy_pdbs()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc")
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)