2021-10-28 14:07:18 +08:00
|
|
|
if (VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_IOS)
|
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
endif()
|
|
|
|
|
2020-10-09 14:28:05 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO PixarAnimationStudios/OpenSubdiv
|
2022-10-22 06:26:55 +08:00
|
|
|
REF 8ffa2b6566be10209529d7a0d1db02a0796b160c # v3.5.0
|
|
|
|
SHA512 cb48470f044ca4e9fcdfb3ff05d710fd710212d5a2f539f3f90ebb33cc6a6b1530fd9deb7d3eb25b275133dbdf5c1a5d4777b289d13b15006a59db12e8b28398
|
2022-10-09 13:01:28 +08:00
|
|
|
HEAD_REF release
|
2020-10-09 14:28:05 +08:00
|
|
|
PATCHES
|
|
|
|
fix_compile-option.patch
|
2021-07-15 03:46:05 +08:00
|
|
|
fix-version-search.patch
|
2021-10-28 14:07:18 +08:00
|
|
|
fix-build-type.patch
|
|
|
|
fix-dependencies.patch
|
2023-12-15 14:57:21 +08:00
|
|
|
fix-feature-cuda.patch
|
2024-04-27 01:19:43 +08:00
|
|
|
fix-notfind-header.patch
|
2020-10-09 14:28:05 +08:00
|
|
|
)
|
|
|
|
|
2020-10-31 03:53:55 +08:00
|
|
|
if(VCPKG_TARGET_IS_LINUX)
|
|
|
|
message(
|
|
|
|
"OpenSubdiv currently requires the following libraries from the system package manager:
|
2021-07-15 03:46:05 +08:00
|
|
|
xinerama xxf86vm
|
2020-10-31 03:53:55 +08:00
|
|
|
|
2021-07-15 03:46:05 +08:00
|
|
|
These can be installed on Ubuntu systems via sudo apt install libxinerama-dev libxxf86vm-dev")
|
2020-10-31 03:53:55 +08:00
|
|
|
endif()
|
|
|
|
|
2022-10-09 13:01:28 +08:00
|
|
|
vcpkg_find_acquire_program(PYTHON3)
|
|
|
|
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
|
|
|
|
vcpkg_add_to_path("${PYTHON3_DIR}")
|
2020-10-09 14:28:05 +08:00
|
|
|
|
|
|
|
if (VCPKG_CRT_LINKAGE STREQUAL static)
|
|
|
|
set(STATIC_CRT_LNK ON)
|
|
|
|
else()
|
|
|
|
set(STATIC_CRT_LNK OFF)
|
|
|
|
endif()
|
|
|
|
|
2021-10-28 14:07:18 +08:00
|
|
|
if ("cuda" IN_LIST FEATURES AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
|
|
|
|
message(FATAL_ERROR "Feature 'cuda' can only build on x64 arch.")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (("dx" IN_LIST FEATURES OR "omp" IN_LIST FEATURES) AND NOT VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
message(FATAL_ERROR "Feature 'dx' and 'omp' only support Windows.")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
|
|
|
"true-deriv-eval" OPENSUBDIV_GREGORY_EVAL_TRUE_DERIVATIVES
|
|
|
|
INVERTED_FEATURES
|
|
|
|
"cuda" NO_CUDA
|
|
|
|
"dx" NO_DX
|
2022-10-22 06:26:55 +08:00
|
|
|
"examples" NO_EXAMPLES
|
2021-10-28 14:07:18 +08:00
|
|
|
"glew" NO_GLEW
|
|
|
|
"glfw" NO_GLFW
|
|
|
|
"glfw" NO_GLFW_X11
|
|
|
|
"omp" NO_OMP
|
|
|
|
"opencl" NO_OPENCL
|
2022-10-22 06:26:55 +08:00
|
|
|
"opengl" NO_OPENGL
|
2021-10-28 14:07:18 +08:00
|
|
|
"ptex" NO_PTEX
|
|
|
|
"tbb" NO_TBB
|
2022-10-22 06:26:55 +08:00
|
|
|
"tutorials" NO_TUTORIALS
|
2021-10-28 14:07:18 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
set(OSD_EXTRA_OPTS)
|
|
|
|
if ("ptex" IN_LIST FEATURES)
|
|
|
|
list(APPEND OSD_EXTRA_OPTS -DPTEX_LOCATION=${CURRENT_INSTALLED_DIR})
|
|
|
|
endif()
|
|
|
|
if ("glew" IN_LIST FEATURES)
|
|
|
|
list(APPEND OSD_EXTRA_OPTS -DGLEW_LOCATION=${CURRENT_INSTALLED_DIR})
|
|
|
|
endif()
|
|
|
|
if ("glfw" IN_LIST FEATURES)
|
|
|
|
list(APPEND OSD_EXTRA_OPTS -DGLFW_LOCATION=${CURRENT_INSTALLED_DIR})
|
|
|
|
endif()
|
|
|
|
if ("dx" IN_LIST FEATURES)
|
|
|
|
list(APPEND OSD_EXTRA_OPTS -DDXSDK_LOCATION=${CURRENT_INSTALLED_DIR})
|
|
|
|
endif()
|
2022-10-22 06:26:55 +08:00
|
|
|
if (VCPKG_TARGET_IS_OSX)
|
|
|
|
list(APPEND OSD_EXTRA_OPTS -DNO_METAL=OFF)
|
|
|
|
else()
|
|
|
|
list(APPEND OSD_EXTRA_OPTS -DNO_METAL=ON)
|
|
|
|
endif()
|
2021-10-28 14:07:18 +08:00
|
|
|
|
|
|
|
vcpkg_cmake_configure(
|
2020-10-09 14:28:05 +08:00
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
OPTIONS
|
2021-10-28 14:07:18 +08:00
|
|
|
-DMSVC_STATIC_CRT=${STATIC_CRT_LNK}
|
|
|
|
-DNO_LIB=OFF
|
2020-10-09 14:28:05 +08:00
|
|
|
-DNO_REGRESSION=ON
|
2021-10-28 14:07:18 +08:00
|
|
|
-DNO_DOC=ON
|
2020-10-09 14:28:05 +08:00
|
|
|
-DNO_TESTS=ON
|
2021-10-28 14:07:18 +08:00
|
|
|
-DNO_GLTESTS=ON
|
|
|
|
-DNO_CLEW=ON
|
|
|
|
${FEATURE_OPTIONS}
|
|
|
|
${OSD_EXTRA_OPTS}
|
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
MSVC_STATIC_CRT
|
2020-10-09 14:28:05 +08:00
|
|
|
)
|
|
|
|
|
2021-10-28 14:07:18 +08:00
|
|
|
vcpkg_cmake_install()
|
2020-10-09 14:28:05 +08:00
|
|
|
|
2021-10-28 14:07:18 +08:00
|
|
|
if ("examples" IN_LIST FEATURES)
|
|
|
|
if ("dx" IN_LIST FEATURES)
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES dxViewer AUTO_CLEAN)
|
|
|
|
if ("ptex" IN_LIST FEATURES)
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES dxPtexViewer AUTO_CLEAN)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
2020-10-09 14:28:05 +08:00
|
|
|
|
2021-10-28 14:07:18 +08:00
|
|
|
if ("tutorials" IN_LIST FEATURES)
|
|
|
|
file(GLOB TUTORIALS_TOOLS "${CURRENT_PACKAGES_DIR}/bin/tutorials/*${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
|
|
|
|
set(TUTORIALS_TOOL_NAMES )
|
|
|
|
foreach(TUTORIALS_TOOL IN LISTS TUTORIALS_TOOLS)
|
|
|
|
get_filename_component(TUTORIALS_TOOL_NAME "${TUTORIALS_TOOL}" NAME_WE)
|
|
|
|
list(APPEND TUTORIALS_TOOL_NAMES "${TUTORIALS_TOOL_NAME}")
|
|
|
|
endforeach()
|
|
|
|
if (TUTORIALS_TOOL_NAMES)
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES ${TUTORIALS_TOOL_NAMES} SEARCH_DIR "${CURRENT_PACKAGES_DIR}/bin/tutorials/" AUTO_CLEAN)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2022-10-22 06:26:55 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME OpenSubdiv CONFIG_PATH lib/cmake/OpenSubdiv)
|
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
|
2021-10-28 14:07:18 +08:00
|
|
|
# The header files are read only and can't remove when remove this port
|
|
|
|
file(GLOB_RECURSE OSD_HDRS "${CURRENT_PACKAGES_DIR}/include/*.h")
|
2022-01-26 02:31:15 +08:00
|
|
|
file(CHMOD_RECURSE ${OSD_HDRS}
|
2021-10-28 14:07:18 +08:00
|
|
|
PERMISSIONS
|
|
|
|
OWNER_READ OWNER_WRITE
|
|
|
|
GROUP_READ GROUP_WRITE
|
|
|
|
WORLD_READ WORLD_WRITE
|
|
|
|
)
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/bin"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/bin"
|
|
|
|
)
|
2020-10-09 14:28:05 +08:00
|
|
|
|
2023-12-15 14:57:21 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
|