2023-11-22 11:51:11 +08:00
|
|
|
string(REPLACE "." "_" VERSION_STR "V${VERSION}")
|
2020-10-09 12:56:28 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO Open-Cascade-SAS/OCCT
|
2023-11-22 11:51:11 +08:00
|
|
|
REF "${VERSION_STR}"
|
|
|
|
SHA512 d9e882d44bb65616f8cfce68ebdcd5765669b84e3d82cfb2d1bc22b71b0e878442c079bacc37e9d54f28ce98a7c23bf81f2a3e3e7bbeeec38927ca739f423dee
|
2020-10-09 12:56:28 +08:00
|
|
|
HEAD_REF master
|
2020-12-05 08:38:05 +08:00
|
|
|
PATCHES
|
2023-11-22 11:51:11 +08:00
|
|
|
dependencies.patch
|
|
|
|
drop-bin-letter-d.patch
|
2021-02-04 03:16:04 +08:00
|
|
|
fix-pdb-find.patch
|
2021-03-23 06:19:06 +08:00
|
|
|
fix-install-prefix-path.patch
|
|
|
|
install-include-dir.patch
|
2024-01-10 03:01:57 +08:00
|
|
|
fix-link-freeimage.patch
|
2020-10-09 12:56:28 +08:00
|
|
|
)
|
|
|
|
|
2023-05-17 23:57:42 +08:00
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
2020-12-05 08:38:05 +08:00
|
|
|
set(BUILD_TYPE "Shared")
|
|
|
|
else()
|
|
|
|
set(BUILD_TYPE "Static")
|
|
|
|
endif()
|
|
|
|
|
2020-10-09 12:56:28 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2021-10-22 15:49:45 +08:00
|
|
|
FEATURES
|
2023-11-22 11:51:11 +08:00
|
|
|
freeimage USE_FREEIMAGE
|
|
|
|
freetype USE_FREETYPE
|
|
|
|
rapidjson USE_RAPIDJSON
|
|
|
|
samples INSTALL_SAMPLES
|
|
|
|
tbb USE_TBB
|
|
|
|
vtk USE_VTK
|
2020-10-09 12:56:28 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# We turn off BUILD_MODULE_Draw as it requires TCL 8.6 and TK 8.6 specifically which conflicts with vcpkg only having TCL 9.0
|
|
|
|
# And pre-built ActiveTCL binaries are behind a marketing wall :(
|
|
|
|
# We use the Unix install layout for Windows as it matches vcpkg
|
2021-10-22 15:49:45 +08:00
|
|
|
vcpkg_cmake_configure(
|
2021-11-13 08:40:40 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
OPTIONS
|
|
|
|
${FEATURE_OPTIONS}
|
2020-12-05 08:38:05 +08:00
|
|
|
-DBUILD_LIBRARY_TYPE=${BUILD_TYPE}
|
2020-10-09 12:56:28 +08:00
|
|
|
-DBUILD_MODULE_Draw=OFF
|
|
|
|
-DBUILD_DOC_Overview=OFF
|
2023-09-14 06:32:26 +08:00
|
|
|
-DBUILD_MODULE_DETools=OFF
|
2023-11-22 11:51:11 +08:00
|
|
|
-DINSTALL_DIR_LAYOUT=Unix
|
|
|
|
-DINSTALL_DIR_DOC=share/trash
|
|
|
|
-DINSTALL_DIR_SCRIPT=share/trash # not relocatable
|
|
|
|
-DINSTALL_TEST_CASES=OFF
|
|
|
|
-DUSE_TK=OFF
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DINSTALL_SAMPLES=OFF
|
2020-10-09 12:56:28 +08:00
|
|
|
)
|
|
|
|
|
2021-10-22 15:49:45 +08:00
|
|
|
vcpkg_cmake_install()
|
2020-10-09 12:56:28 +08:00
|
|
|
|
2021-10-22 15:49:45 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/opencascade)
|
2021-03-23 06:19:06 +08:00
|
|
|
|
|
|
|
#make occt includes relative to source_file
|
2023-11-22 11:51:11 +08:00
|
|
|
file(GLOB extra_headers
|
|
|
|
LIST_DIRECTORIES false
|
|
|
|
RELATIVE "${CURRENT_PACKAGES_DIR}/include/opencascade"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/include/opencascade/*.h"
|
|
|
|
)
|
|
|
|
list(JOIN extra_headers "|" extra_headers)
|
|
|
|
file(GLOB files "${CURRENT_PACKAGES_DIR}/include/opencascade/*.[hgl]xx")
|
2021-10-22 15:49:45 +08:00
|
|
|
foreach(file_name IN LISTS files)
|
2022-05-10 05:12:27 +08:00
|
|
|
file(READ "${file_name}" filedata)
|
2023-11-22 11:51:11 +08:00
|
|
|
string(REGEX REPLACE "(# *include) <([a-zA-Z0-9_]*[.][hgl]xx|${extra_headers})>" [[\1 "\2"]] filedata "${filedata}")
|
2022-05-10 05:12:27 +08:00
|
|
|
file(WRITE "${file_name}" "${filedata}")
|
2021-03-23 06:19:06 +08:00
|
|
|
endforeach()
|
2020-10-09 12:56:28 +08:00
|
|
|
|
2021-10-22 15:49:45 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2023-11-22 11:51:11 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/opencascade/samples/qt")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/trash")
|
2020-10-09 12:56:28 +08:00
|
|
|
|
2023-11-22 11:51:11 +08:00
|
|
|
vcpkg_install_copyright(
|
|
|
|
FILE_LIST
|
|
|
|
"${SOURCE_PATH}/LICENSE_LGPL_21.txt"
|
|
|
|
"${SOURCE_PATH}/OCCT_LGPL_EXCEPTION.txt"
|
|
|
|
)
|