2019-05-15 07:20:32 +08:00
|
|
|
# Don't file if the bin folder exists. We need exe and custom files.
|
|
|
|
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
|
|
|
|
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO PixarAnimationStudios/USD
|
2020-11-13 04:37:53 +08:00
|
|
|
REF 71b4baace2044ea4400ba802e91667f9ebe342f0 # v20.08
|
|
|
|
SHA512 0f23b84d314d88d3524f22ebc344e2b506cb7e8ac064726df432a968a4bae0fd2249e968bd10845de9067290eaaa3f8c9e2a483551ffc06b826f3eba816061a9
|
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
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_find_acquire_program(PYTHON2)
|
|
|
|
get_filename_component(PYTHON2_DIR "${PYTHON2}" DIRECTORY)
|
|
|
|
vcpkg_add_to_path("${PYTHON2_DIR}")
|
|
|
|
|
2020-11-13 04:37:53 +08:00
|
|
|
IF (VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
ELSE()
|
|
|
|
file(REMOVE ${SOURCE_PATH}/cmake/modules/FindTBB.cmake)
|
|
|
|
ENDIF()
|
|
|
|
|
2019-05-15 07:20:32 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2019-08-01 04:01:02 +08:00
|
|
|
PREFER_NINJA
|
2019-05-15 07:20:32 +08:00
|
|
|
OPTIONS
|
|
|
|
-DPXR_BUILD_ALEMBIC_PLUGIN:BOOL=OFF
|
|
|
|
-DPXR_BUILD_EMBREE_PLUGIN:BOOL=OFF
|
|
|
|
-DPXR_BUILD_IMAGING:BOOL=OFF
|
|
|
|
-DPXR_BUILD_MAYA_PLUGIN: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
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
|
|
|
file(
|
|
|
|
RENAME
|
|
|
|
"${CURRENT_PACKAGES_DIR}/pxrConfig.cmake"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/cmake/pxrConfig.cmake")
|
|
|
|
|
2020-11-13 04:37:53 +08:00
|
|
|
vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/pxr)
|
2019-05-15 07:20:32 +08:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
|
|
|
# Remove duplicates in debug folder
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
|
|
|
|
|
|
|
# Handle copyright
|
2020-11-13 04:37:53 +08:00
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
2019-05-15 07:20:32 +08:00
|
|
|
|
|
|
|
# Move all dlls to bin
|
|
|
|
file(GLOB RELEASE_DLL ${CURRENT_PACKAGES_DIR}/lib/*.dll)
|
2020-11-13 04:37:53 +08:00
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin)
|
2019-05-15 07:20:32 +08:00
|
|
|
file(GLOB DEBUG_DLL ${CURRENT_PACKAGES_DIR}/debug/lib/*.dll)
|
2020-11-13 04:37:53 +08:00
|
|
|
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin)
|
2019-05-15 07:20:32 +08:00
|
|
|
foreach(CURRENT_FROM ${RELEASE_DLL} ${DEBUG_DLL})
|
|
|
|
string(REPLACE "/lib/" "/bin/" CURRENT_TO ${CURRENT_FROM})
|
|
|
|
file(RENAME ${CURRENT_FROM} ${CURRENT_TO})
|
|
|
|
endforeach()
|
2020-11-13 04:37:53 +08:00
|
|
|
|
|
|
|
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/pxrConfig.cmake "/cmake/pxrTargets.cmake" "/pxrTargets.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()
|