2019-05-15 07:20:32 +08:00
|
|
|
# Don't file if the bin folder exists. We need exe and custom files.
|
2023-05-11 02:16:12 +08:00
|
|
|
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
2019-05-15 07:20:32 +08:00
|
|
|
|
2022-09-24 03:03:33 +08:00
|
|
|
message(STATUS [=[
|
2023-06-15 03:39:27 +08:00
|
|
|
The usd port does not work with the version of Threading Building Blocks (tbb) currently chosen by vcpkg's baselines,
|
2022-09-24 03:03:33 +08:00
|
|
|
and does not expect to be updated to work with current versions soon. See
|
|
|
|
https://github.com/PixarAnimationStudios/USD/issues/1600
|
|
|
|
|
|
|
|
If you must use this port in your project, pin a version of tbb of 2020_U3 or older via a manifest file.
|
|
|
|
See https://vcpkg.io/en/docs/examples/versioning.getting-started.html for instructions.
|
|
|
|
]=])
|
|
|
|
|
2023-03-16 01:50:48 +08:00
|
|
|
string(REGEX REPLACE "^([0-9]+)[.]([0-9])\$" "\\1.0\\2" USD_VERSION "${VERSION}")
|
|
|
|
|
2019-05-15 07:20:32 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2023-06-30 05:35:57 +08:00
|
|
|
REPO PixarAnimationStudios/OpenUSD
|
2023-03-16 01:50:48 +08:00
|
|
|
REF "v${USD_VERSION}"
|
2024-05-04 06:27:30 +08:00
|
|
|
SHA512 e510f6421caba5e74c6efe5b56b17e9c9741ece0cfd5020148ca89b3ac32bd8781ab00dfc7a134163c85af3f4f01f2529a9baa5a9df9b0c80cbca003e6d199e2
|
2019-05-15 07:20:32 +08:00
|
|
|
HEAD_REF master
|
2020-06-11 15:29:20 +08:00
|
|
|
PATCHES
|
2020-11-13 04:37:53 +08:00
|
|
|
fix_build-location.patch
|
2019-05-15 07:20:32 +08:00
|
|
|
)
|
|
|
|
|
2023-05-11 02:16:12 +08:00
|
|
|
if(NOT VCPKG_TARGET_IS_WINDOWS)
|
2020-11-13 04:37:53 +08:00
|
|
|
file(REMOVE ${SOURCE_PATH}/cmake/modules/FindTBB.cmake)
|
2023-05-11 02:16:12 +08:00
|
|
|
endif()
|
2020-11-13 04:37:53 +08:00
|
|
|
|
2022-10-06 05:59:14 +08:00
|
|
|
vcpkg_cmake_configure(
|
2019-05-15 07:20:32 +08:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
OPTIONS
|
|
|
|
-DPXR_BUILD_ALEMBIC_PLUGIN:BOOL=OFF
|
|
|
|
-DPXR_BUILD_EMBREE_PLUGIN:BOOL=OFF
|
|
|
|
-DPXR_BUILD_IMAGING:BOOL=OFF
|
|
|
|
-DPXR_BUILD_MONOLITHIC:BOOL=OFF
|
|
|
|
-DPXR_BUILD_TESTS:BOOL=OFF
|
|
|
|
-DPXR_BUILD_USD_IMAGING:BOOL=OFF
|
|
|
|
-DPXR_ENABLE_PYTHON_SUPPORT:BOOL=OFF
|
2020-11-13 04:37:53 +08:00
|
|
|
-DPXR_BUILD_EXAMPLES:BOOL=OFF
|
|
|
|
-DPXR_BUILD_TUTORIALS:BOOL=OFF
|
|
|
|
-DPXR_BUILD_USD_TOOLS:BOOL=OFF
|
2019-05-15 07:20:32 +08:00
|
|
|
)
|
|
|
|
|
2022-10-06 05:59:14 +08:00
|
|
|
vcpkg_cmake_install()
|
2019-05-15 07:20:32 +08:00
|
|
|
|
2023-06-15 03:39:27 +08:00
|
|
|
# The CMake files installation is not standard in USD and will install pxrConfig.cmake in the prefix root and
|
|
|
|
# pxrTargets.cmake in "cmake" so we are moving pxrConfig.cmake in the same folder and patch the path to pxrTargets.cmake
|
|
|
|
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/pxrConfig.cmake "/cmake/pxrTargets.cmake" "/pxrTargets.cmake")
|
|
|
|
|
2019-05-15 07:20:32 +08:00
|
|
|
file(
|
|
|
|
RENAME
|
|
|
|
"${CURRENT_PACKAGES_DIR}/pxrConfig.cmake"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/cmake/pxrConfig.cmake")
|
|
|
|
|
2022-10-06 05:59:14 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH cmake PACKAGE_NAME pxr)
|
2019-05-15 07:20:32 +08:00
|
|
|
|
|
|
|
# Remove duplicates in debug folder
|
2023-03-16 01:50:48 +08:00
|
|
|
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/pxrConfig.cmake)
|
2019-05-15 07:20:32 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
|
|
|
|
# Handle copyright
|
2023-06-15 03:39:27 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST ${SOURCE_PATH}/LICENSE.txt)
|
|
|
|
|
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
# Move all dlls to bin
|
|
|
|
file(GLOB RELEASE_DLL ${CURRENT_PACKAGES_DIR}/lib/*.dll)
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin)
|
|
|
|
file(GLOB DEBUG_DLL ${CURRENT_PACKAGES_DIR}/debug/lib/*.dll)
|
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin)
|
|
|
|
foreach(CURRENT_FROM ${RELEASE_DLL} ${DEBUG_DLL})
|
|
|
|
string(REPLACE "/lib/" "/bin/" CURRENT_TO ${CURRENT_FROM})
|
|
|
|
file(RENAME ${CURRENT_FROM} ${CURRENT_TO})
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
|
|
|
function(file_replace_regex filename match_string replace_string)
|
|
|
|
file(READ ${filename} _contents)
|
|
|
|
string(REGEX REPLACE "${match_string}" "${replace_string}" _contents "${_contents}")
|
|
|
|
file(WRITE ${filename} "${_contents}")
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
# fix dll path for cmake
|
|
|
|
file_replace_regex(${CURRENT_PACKAGES_DIR}/share/pxr/pxrTargets-debug.cmake "debug/lib/([a-zA-Z0-9_]+)\\.dll" "debug/bin/\\1.dll")
|
|
|
|
file_replace_regex(${CURRENT_PACKAGES_DIR}/share/pxr/pxrTargets-release.cmake "lib/([a-zA-Z0-9_]+)\\.dll" "bin/\\1.dll")
|
|
|
|
|
|
|
|
# fix plugInfo.json for runtime
|
|
|
|
file(GLOB_RECURSE PLUGINFO_FILES ${CURRENT_PACKAGES_DIR}/lib/usd/*/resources/plugInfo.json)
|
|
|
|
file(GLOB_RECURSE PLUGINFO_FILES_DEBUG ${CURRENT_PACKAGES_DIR}/debug/lib/usd/*/resources/plugInfo.json)
|
|
|
|
foreach(PLUGINFO ${PLUGINFO_FILES} ${PLUGINFO_FILES_DEBUG})
|
|
|
|
file_replace_regex(${PLUGINFO} [=["LibraryPath": "../../([a-zA-Z0-9_]+).dll"]=] [=["LibraryPath": "../../../bin/\1.dll"]=])
|
|
|
|
endforeach()
|
|
|
|
endif()
|