portfile.cmake 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. vcpkg_from_github(
  2. OUT_SOURCE_PATH SOURCE_PATH
  3. REPO libsndfile/libsndfile
  4. REF 1.1.0
  5. SHA512 5e530c33165a2d2be1c22d3a4bd96f0f1817dded3a45d24bad0e3f2c7908ccc1f19327a91d5040c3ea4d591845876019180747a125bf2a6f8bd49a6f67eadacd
  6. HEAD_REF master
  7. PATCHES
  8. fix-mp3lame.patch
  9. fix-uwp.patch
  10. fix-wavlike.patch
  11. )
  12. if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
  13. vcpkg_find_acquire_program(PYTHON3)
  14. endif()
  15. vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
  16. FEATURES
  17. external-libs ENABLE_EXTERNAL_LIBS
  18. mpeg ENABLE_MPEG
  19. regtest BUILD_REGTEST
  20. )
  21. if(VCPKG_TARGET_IS_UWP)
  22. set(VCPKG_C_FLAGS "/sdl- ${VCPKG_C_FLAGS}")
  23. set(VCPKG_CXX_FLAGS "/sdl- ${VCPKG_CXX_FLAGS}")
  24. endif()
  25. vcpkg_cmake_configure(
  26. SOURCE_PATH "${SOURCE_PATH}"
  27. OPTIONS
  28. -DBUILD_EXAMPLES=OFF
  29. -DBUILD_TESTING=OFF
  30. -DENABLE_BOW_DOCS=OFF
  31. -DBUILD_PROGRAMS=OFF
  32. -DBUILD_REGTEST=OFF
  33. -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON
  34. -DPYTHON_EXECUTABLE=${PYTHON3}
  35. ${FEATURE_OPTIONS}
  36. MAYBE_UNUSED_VARIABLES
  37. PYTHON_EXECUTABLE
  38. )
  39. vcpkg_cmake_install()
  40. if(WIN32 AND (NOT MINGW) AND (NOT CYGWIN))
  41. set(CONFIG_PATH cmake)
  42. else()
  43. set(CONFIG_PATH lib/cmake/SndFile)
  44. endif()
  45. vcpkg_cmake_config_fixup(PACKAGE_NAME SndFile CONFIG_PATH "${CONFIG_PATH}")
  46. vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m)
  47. vcpkg_copy_pdbs()
  48. file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
  49. file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
  50. file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc")
  51. file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)