vcpkg/ports/libsoundio/portfile.cmake
Tsukasa Sugiura 889fa61c29 [libsoundio] Add libsoundio port (#8273)
* [libsoundio] Add libsoundio port

* [libsoundio] Add description and homepage

* [libsoundio] WindowsStore not supported

* [libsoundio] Fix libsoundio-config.cmake

* [libsoundio] Fix CMakeLists for Linux
2019-09-23 12:27:07 -07:00

42 lines
1.2 KiB
CMake

include(vcpkg_common_functions)
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
message(FATAL_ERROR "WindowsStore not supported")
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO andrewrk/libsoundio
REF 2.0.0
SHA512 347a9be1789a41e778ea8d0efa1d00e03e725a4ab65e3aaf6c71e49138643f08a50a81bd60087d86a3b4d63beaeec617e47ba6b81f829ece8a3ac17418eb5309
HEAD_REF master
PATCHES
fix_cmakelists.patch
fix_example.patch
fix_test.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED_LIBS)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
-DBUILD_EXAMPLE_PROGRAMS=OFF
-DBUILD_TESTS=OFF
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets()
vcpkg_copy_pdbs()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
endif()
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/libsoundio RENAME copyright)
vcpkg_test_cmake(PACKAGE_NAME libsoundio)