Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into gary/ios-simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
garywang committed Jul 21, 2023
2 parents 5ec42d7 + 1294e9a commit cb37764
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 52 deletions.
4 changes: 2 additions & 2 deletions ports/open3d/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO polycam/open3d
REF a0d85e641a250762c8fa6a6ee9d9e16df9e0e11e
SHA512 3a421b1c34f8e38d4802ff7fadc994c9f2b0bcbe03c51b97402661115c0a088294731fbdf7a67217f38b111c6e24e20d8c293daf03a0fbc1b5993135dfc1ae75
REF 27c63d98080a5442395a69326a0c17b245c96941
SHA512 f20206b22766249f3a3e08fbf82f9ed26229d503d9ac770650131735d71210f2fc284c8180a5b5b266842fad1ca3ed00e78522d55b1f669a175ad069491760e9
HEAD_REF main
)

Expand Down
4 changes: 2 additions & 2 deletions ports/openssl/unix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Android" OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
else()
set(PLATFORM linux-generic32)
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "visionOS")
elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS")
if(VCPKG_TARGET_ARCHITECTURE MATCHES "arm64")
set(PLATFORM ios64-xcrun)
elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "arm")
Expand Down Expand Up @@ -108,7 +108,7 @@ if(BUILD_SHARED_LIBS)
string(REGEX REPLACE "^(SHLIB_VERSION=)(.*)$" "\\2"
SHLIB_VERSION "${SHLIB_VERSION}")

if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "visionOS")
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(LIB_EXT dylib)
set(LIB_EXTS ${SHLIB_VERSION}.${LIB_EXT})
elseif(MINGW)
Expand Down
15 changes: 15 additions & 0 deletions ports/usd/find-tbb.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/cmake/defaults/Packages.cmake b/cmake/defaults/Packages.cmake
index 2bb1f30d0..5700090d4 100644
--- a/cmake/defaults/Packages.cmake
+++ b/cmake/defaults/Packages.cmake
@@ -152,8 +152,8 @@ endif()


# --TBB
-find_package(TBB REQUIRED COMPONENTS tbb)
-add_definitions(${TBB_DEFINITIONS})
+find_package(TBB CONFIG REQUIRED)
+set(TBB_tbb_LIBRARY "TBB::tbb")

# --math
if(WIN32)
2 changes: 1 addition & 1 deletion ports/usd/fix_build-location.patch
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ index 3825e2a19..0a79b49bd 100644
+ PXR_BUILD_LOCATION=../lib/usd
PXR_PLUGIN_BUILD_LOCATION=../plugin/usd
${pxrInstallLocation}
${pythonModulesEnabled}
${apiPrivate}
88 changes: 44 additions & 44 deletions ports/usd/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,34 +1,28 @@
# Don't file if the bin folder exists. We need exe and custom files.
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled)
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO PixarAnimationStudios/USD
REF 71b4baace2044ea4400ba802e91667f9ebe342f0 # v20.08
SHA512 0f23b84d314d88d3524f22ebc344e2b506cb7e8ac064726df432a968a4bae0fd2249e968bd10845de9067290eaaa3f8c9e2a483551ffc06b826f3eba816061a9
REPO PixarAnimationStudios/OpenUSD
REF b53573ea2a6b29bc4a6b129f604bbb342c35df5c #v23.05
SHA512 9e6ed135fc7a7f27e52d83696bc425937ae88c2a0da2a4902ae32e304348f7735905945eef30c508b1c80238aa039c3d36a591441e13eee8be21e35ebb509398
HEAD_REF master
PATCHES
fix_build-location.patch
find-tbb.patch
)

vcpkg_find_acquire_program(PYTHON2)
get_filename_component(PYTHON2_DIR "${PYTHON2}" DIRECTORY)
vcpkg_add_to_path("${PYTHON2_DIR}")

IF (VCPKG_TARGET_IS_WINDOWS)
ELSE()
if(NOT VCPKG_TARGET_IS_WINDOWS)
file(REMOVE ${SOURCE_PATH}/cmake/modules/FindTBB.cmake)
ENDIF()
endif()

vcpkg_configure_cmake(
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
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_MONOLITHIC:BOOL=ON
-DPXR_BUILD_TESTS:BOOL=OFF
-DPXR_BUILD_USD_IMAGING:BOOL=OFF
-DPXR_ENABLE_PYTHON_SUPPORT:BOOL=OFF
Expand All @@ -37,47 +31,53 @@ vcpkg_configure_cmake(
-DPXR_BUILD_USD_TOOLS:BOOL=OFF
)

vcpkg_install_cmake()
vcpkg_cmake_install()

# 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")

file(
RENAME
"${CURRENT_PACKAGES_DIR}/pxrConfig.cmake"
"${CURRENT_PACKAGES_DIR}/cmake/pxrConfig.cmake")

vcpkg_fixup_cmake_targets(CONFIG_PATH cmake TARGET_PATH share/pxr)

vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(CONFIG_PATH cmake PACKAGE_NAME pxr)

# Remove duplicates in debug folder
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/pxrConfig.cmake)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
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()

# 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()
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 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()
# 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()
15 changes: 12 additions & 3 deletions ports/usd/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "usd",
"version-string": "20.08",
"port-version": 2,
"version": "23.5",
"port-version": 3,
"description": "Universal Scene Description (USD) is an efficient, scalable system for authoring, reading, and streaming time-sampled scene description for interchange between graphics applications.",
"homepage": "https://github.com/PixarAnimationStudios/USD",
"supports": "!x86",
"license": null,
"dependencies": [
"boost-assign",
"boost-crc",
Expand All @@ -15,8 +15,17 @@
"boost-program-options",
"boost-regex",
"boost-system",
"boost-variant",
"boost-vmd",
"tbb",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"zlib"
]
}

0 comments on commit cb37764

Please sign in to comment.