2019-05-03 13:57:43 +08:00
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
|
2017-07-21 21:03:10 +08:00
|
|
|
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
|
|
|
|
message(FATAL_ERROR "UWP builds not supported")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO xiph/opusfile
|
2023-02-10 03:04:21 +08:00
|
|
|
REF "v${VERSION}"
|
|
|
|
SHA512 c134b86a444acc3383b785bf89d02734d955b0547fd2ae55afa821b347d6a312130922893f5a27f48e822a6fddc35301048079e365b64c62cd3c7cadb33233b5
|
2017-07-21 21:03:10 +08:00
|
|
|
HEAD_REF master)
|
|
|
|
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
|
|
|
|
2023-02-10 03:04:21 +08:00
|
|
|
vcpkg_check_features(
|
|
|
|
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
|
|
|
opusurl BUILD_OPUSURL
|
|
|
|
)
|
2018-08-08 18:04:44 +08:00
|
|
|
|
2023-02-10 03:04:21 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2018-08-08 18:04:44 +08:00
|
|
|
OPTIONS
|
2023-02-10 03:04:21 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2019-05-03 13:57:43 +08:00
|
|
|
OPTIONS_DEBUG
|
2017-07-21 21:03:10 +08:00
|
|
|
-DOPUSFILE_SKIP_HEADERS=ON)
|
|
|
|
|
2023-02-10 03:04:21 +08:00
|
|
|
vcpkg_cmake_install()
|
2017-07-21 21:03:10 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2023-02-10 03:04:21 +08:00
|
|
|
# Create the pkg-config files
|
|
|
|
set(prefix "")
|
|
|
|
set(exec_prefix "\${prefix}")
|
|
|
|
set(libdir "\${prefix}/lib")
|
|
|
|
set(includedir "\${prefix}/include")
|
|
|
|
set(PACKAGE_VERSION "${VERSION}")
|
|
|
|
set(lrintf_lib "")
|
|
|
|
configure_file("${SOURCE_PATH}/opusfile.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/opusfile.pc" @ONLY)
|
|
|
|
if(NOT VCPKG_BUILD_TYPE)
|
|
|
|
configure_file("${SOURCE_PATH}/opusfile.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/opusfile.pc" @ONLY)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(opusurl IN_LIST FEATURES)
|
|
|
|
set(openssl "openssl")
|
|
|
|
configure_file("${SOURCE_PATH}/opusurl.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/opusurl.pc" @ONLY)
|
|
|
|
if(NOT VCPKG_BUILD_TYPE)
|
|
|
|
configure_file("${SOURCE_PATH}/opusurl.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/opusurl.pc" @ONLY)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
|
2017-07-21 21:03:10 +08:00
|
|
|
# make includes work with MSBuild integration
|
2023-02-10 03:04:21 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/opus/opusfile.h" "# include <opus_multistream.h>" "# include \"opus_multistream.h\"")
|
2017-07-21 21:03:10 +08:00
|
|
|
|
2023-02-10 03:04:21 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
|