2023-11-22 04:51:11 +01:00
|
|
|
string(REPLACE "." "_" VERSION_STR "V${VERSION}")
|
2020-10-09 00:56:28 -04:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO Open-Cascade-SAS/OCCT
|
2023-11-22 04:51:11 +01:00
|
|
|
REF "${VERSION_STR}"
|
2024-04-09 15:29:42 +00:00
|
|
|
SHA512 807c1f8732926cfdabcfbdf8d6a0e76b8dba1a1e614afe084a467ffb4cfd80623f5e3afa7e9905b1ac96667c93e01b5f98ceaa8948a576a1093d98df98cc8f81
|
2020-10-09 00:56:28 -04:00
|
|
|
HEAD_REF master
|
2020-12-04 16:38:05 -08:00
|
|
|
PATCHES
|
2023-11-22 04:51:11 +01:00
|
|
|
dependencies.patch
|
|
|
|
drop-bin-letter-d.patch
|
2021-02-04 03:16:04 +08:00
|
|
|
fix-pdb-find.patch
|
2021-03-22 23:19:06 +01:00
|
|
|
fix-install-prefix-path.patch
|
|
|
|
install-include-dir.patch
|
2024-09-03 22:38:18 +03:00
|
|
|
fix-freetype.diff # https://github.com/Open-Cascade-SAS/OCCT/pull/49
|
2020-10-09 00:56:28 -04:00
|
|
|
)
|
|
|
|
|
2023-05-17 23:57:42 +08:00
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
2020-12-04 16:38:05 -08:00
|
|
|
set(BUILD_TYPE "Shared")
|
|
|
|
else()
|
|
|
|
set(BUILD_TYPE "Static")
|
|
|
|
endif()
|
|
|
|
|
2020-10-09 00:56:28 -04:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2021-10-22 15:49:45 +08:00
|
|
|
FEATURES
|
2023-11-22 04:51:11 +01:00
|
|
|
freeimage USE_FREEIMAGE
|
|
|
|
freetype USE_FREETYPE
|
|
|
|
rapidjson USE_RAPIDJSON
|
|
|
|
samples INSTALL_SAMPLES
|
|
|
|
tbb USE_TBB
|
|
|
|
vtk USE_VTK
|
2020-10-09 00:56:28 -04: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-12 16:40:40 -08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
OPTIONS
|
|
|
|
${FEATURE_OPTIONS}
|
2020-12-04 16:38:05 -08:00
|
|
|
-DBUILD_LIBRARY_TYPE=${BUILD_TYPE}
|
2020-10-09 00:56:28 -04:00
|
|
|
-DBUILD_MODULE_Draw=OFF
|
|
|
|
-DBUILD_DOC_Overview=OFF
|
2023-09-14 00:32:26 +02:00
|
|
|
-DBUILD_MODULE_DETools=OFF
|
2023-11-22 04:51:11 +01: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 00:56:28 -04:00
|
|
|
)
|
|
|
|
|
2021-10-22 15:49:45 +08:00
|
|
|
vcpkg_cmake_install()
|
2020-10-09 00:56:28 -04:00
|
|
|
|
2021-10-22 15:49:45 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/opencascade)
|
2021-03-22 23:19:06 +01:00
|
|
|
|
|
|
|
#make occt includes relative to source_file
|
2023-11-22 04:51:11 +01: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 04:51:11 +01: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-22 23:19:06 +01:00
|
|
|
endforeach()
|
2020-10-09 00:56:28 -04: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 04:51:11 +01:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/opencascade/samples/qt")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/trash")
|
2020-10-09 00:56:28 -04:00
|
|
|
|
2023-11-22 04:51:11 +01:00
|
|
|
vcpkg_install_copyright(
|
|
|
|
FILE_LIST
|
|
|
|
"${SOURCE_PATH}/LICENSE_LGPL_21.txt"
|
|
|
|
"${SOURCE_PATH}/OCCT_LGPL_EXCEPTION.txt"
|
|
|
|
)
|