2019-07-16 05:42:45 +08:00
|
|
|
|
2020-08-20 12:16:32 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO KhronosGroup/OpenXR-SDK
|
2022-01-14 02:49:53 +08:00
|
|
|
REF release-1.0.22
|
|
|
|
SHA512 fe3c393c2d11981b42355acd8dbc337727120bcd0ff595abac1975c4ce5f68bb74a9a1b4c959e64e9a847ae5d504100d31979ffd7d9702c55b2dbd889de17d3e
|
2020-08-20 12:16:32 +08:00
|
|
|
HEAD_REF master
|
2020-10-15 01:22:37 +08:00
|
|
|
PATCHES
|
|
|
|
fix-openxr-sdk-jsoncpp.patch
|
2020-08-20 12:16:32 +08:00
|
|
|
)
|
2019-07-16 05:42:45 +08:00
|
|
|
|
2020-08-20 12:16:32 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SDK_SOURCE_PATH
|
|
|
|
REPO KhronosGroup/OpenXR-SDK-Source
|
2022-01-14 02:49:53 +08:00
|
|
|
REF release-1.0.22
|
|
|
|
SHA512 92802d57a45ca1d697d3cea1b3f5619af4ba36156cb28c2c39b2295a74ebc45907caf371c916c54ec3be44a2f3ae447ffc1cd62f54b7b24f7a081408328c7651
|
2020-08-20 12:16:32 +08:00
|
|
|
HEAD_REF master
|
2020-10-15 01:22:37 +08:00
|
|
|
PATCHES
|
|
|
|
fix-openxr-sdk-jsoncpp.patch
|
2020-08-20 12:16:32 +08:00
|
|
|
)
|
2019-07-16 05:42:45 +08:00
|
|
|
|
|
|
|
vcpkg_from_github(
|
2020-08-20 12:16:32 +08:00
|
|
|
OUT_SOURCE_PATH HPP_SOURCE_PATH
|
|
|
|
REPO KhronosGroup/OpenXR-hpp
|
2022-01-14 02:49:53 +08:00
|
|
|
REF release-1.0.21
|
|
|
|
SHA512 cda111f20392a64d5f4de6bd71f1fe7fe39d688bb2376c6b1841763459e32fd6d03b9552804b5ee464ba84cd4c05cfdaa1a6e8a8e5da3eae6b94c7797c65cb36
|
2019-07-16 05:42:45 +08:00
|
|
|
HEAD_REF master
|
2021-08-27 01:54:11 +08:00
|
|
|
PATCHES
|
|
|
|
002-fix-hpp-gen.patch
|
2019-07-16 05:42:45 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# Weird behavior inside the OpenXR loader. On Windows they force shared libraries to use static crt, and
|
2021-12-07 14:43:34 +08:00
|
|
|
# vice-versa. Might be better in future iterations to patch the CMakeLists.txt for OpenXR
|
2020-08-20 12:16:32 +08:00
|
|
|
if (VCPKG_TARGET_IS_UWP OR VCPKG_TARGET_IS_WINDOWS)
|
2019-07-16 05:42:45 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
|
|
|
set(DYNAMIC_LOADER OFF)
|
|
|
|
set(VCPKG_CRT_LINKAGE dynamic)
|
|
|
|
else()
|
|
|
|
set(DYNAMIC_LOADER ON)
|
|
|
|
set(VCPKG_CRT_LINKAGE static)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_find_acquire_program(PYTHON3)
|
|
|
|
|
2021-12-07 14:43:34 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2019-07-16 05:42:45 +08:00
|
|
|
OPTIONS
|
|
|
|
-DBUILD_API_LAYERS=OFF
|
|
|
|
-DBUILD_TESTS=OFF
|
2019-08-01 04:03:44 +08:00
|
|
|
-DBUILD_CONFORMANCE_TESTS=OFF
|
2019-07-16 05:42:45 +08:00
|
|
|
-DDYNAMIC_LOADER=${DYNAMIC_LOADER}
|
2021-12-07 14:43:34 +08:00
|
|
|
-DPYTHON_EXECUTABLE="${PYTHON3}"
|
2020-10-15 01:22:37 +08:00
|
|
|
-DBUILD_WITH_SYSTEM_JSONCPP=ON
|
2019-07-16 05:42:45 +08:00
|
|
|
)
|
|
|
|
|
2021-12-07 14:43:34 +08:00
|
|
|
vcpkg_cmake_install()
|
2019-07-16 05:42:45 +08:00
|
|
|
|
2021-08-27 01:54:11 +08:00
|
|
|
# Generate the OpenXR C++ bindings
|
2021-12-07 14:43:34 +08:00
|
|
|
set(ENV{OPENXR_REPO} "${SDK_SOURCE_PATH}")
|
|
|
|
file(STRINGS "${HPP_SOURCE_PATH}/headers.txt" HEADER_LIST REGEX "^openxr.*")
|
2021-08-27 01:54:11 +08:00
|
|
|
foreach(HEADER ${HEADER_LIST})
|
|
|
|
vcpkg_execute_required_process(
|
2021-12-07 14:43:34 +08:00
|
|
|
COMMAND ${PYTHON3} "${HPP_SOURCE_PATH}/scripts/hpp_genxr.py" -registry "${SDK_SOURCE_PATH}/specification/registry/xr.xml" -o "${CURRENT_PACKAGES_DIR}/include/openxr" ${HEADER}
|
|
|
|
WORKING_DIRECTORY "${HPP_SOURCE_PATH}"
|
2021-08-27 01:54:11 +08:00
|
|
|
LOGNAME openxrhpp
|
|
|
|
)
|
|
|
|
endforeach()
|
2020-08-20 12:16:32 +08:00
|
|
|
|
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
2021-12-07 14:43:34 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH cmake)
|
2020-08-20 12:16:32 +08:00
|
|
|
else(VCPKG_TARGET_IS_WINDOWS)
|
2021-12-07 14:43:34 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/openxr)
|
2020-08-20 12:16:32 +08:00
|
|
|
endif()
|
|
|
|
|
2021-12-07 14:43:34 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2019-07-16 05:42:45 +08:00
|
|
|
|
2022-01-06 12:20:25 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2019-07-16 05:42:45 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2021-12-07 14:43:34 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|