From 11cbb6b57b502d4864fa3c51b36b1ec88527a036 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 22 Nov 2023 04:51:11 +0100 Subject: [PATCH] [opencascade] Cleanup and fixes (#35119) * [opencascade] Use version for git ref * [opencascade] Skip samples for debug * [opencascade] Drop bin letter d * [opencascade] Don't install scripts * [opencascade] qt not supported by port * [opencascade] Update header fixup * [opencascade] Enable osx and arm * [opencascade] No scripts, again * [opencascade] License * [opencascade] Revise deps * [opencascade] No freetype on uwp * Trace * Fixup * [opencascade] only export include/opencascade because this is what upstream provides in OPENCASCADE_INCLUDE_DIRECTORY * [opencascade] Revise dependency setup * [opencascade] Keep vcpkg legacy include dir * Fixup --- ports/opencascade/dependencies.patch | 112 ++++++++++++++++++++ ports/opencascade/drop-bin-letter-d.patch | 45 ++++++++ ports/opencascade/fix-depend-freetype.patch | 15 --- ports/opencascade/fix-depend-vtk.patch | 16 --- ports/opencascade/fix-dependence.patch | 30 ------ ports/opencascade/fix-find-tbb.patch | 18 ---- ports/opencascade/install-include-dir.patch | 13 +-- ports/opencascade/portfile.cmake | 110 ++++++------------- ports/opencascade/vcpkg.json | 33 +++++- versions/baseline.json | 2 +- versions/o-/opencascade.json | 5 + 11 files changed, 229 insertions(+), 170 deletions(-) create mode 100644 ports/opencascade/dependencies.patch create mode 100644 ports/opencascade/drop-bin-letter-d.patch delete mode 100644 ports/opencascade/fix-depend-freetype.patch delete mode 100644 ports/opencascade/fix-depend-vtk.patch delete mode 100644 ports/opencascade/fix-dependence.patch delete mode 100644 ports/opencascade/fix-find-tbb.patch diff --git a/ports/opencascade/dependencies.patch b/ports/opencascade/dependencies.patch new file mode 100644 index 00000000000..d26a420deb0 --- /dev/null +++ b/ports/opencascade/dependencies.patch @@ -0,0 +1,112 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bb6ab2db..e58b1afa 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -596,7 +596,8 @@ if (CAN_USE_FREETYPE) + if (USE_FREETYPE) + message (STATUS "Info: FreeType is used by OCCT") + add_definitions (-DHAVE_FREETYPE) +- OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freetype") ++ find_package(Freetype MODULE REQUIRED) ++ set(CSF_FREETYPE Freetype::Freetype) + else() + OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREETYPE") + OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2") +@@ -613,7 +614,9 @@ endif() + if (USE_VTK) + add_definitions (-DHAVE_VTK) + set (OCCT_VTK_USED_TARGETS "" CACHE INTERNAL "" FORCE) +- OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/vtk") ++ find_package(VTK REQUIRED) ++ set(CSF_VTK VTK::CommonCore) ++ set(IS_VTK_9XX 1) + else() + OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_VTK") + +@@ -629,7 +632,8 @@ endif() + if (CAN_USE_FREEIMAGE) + if (USE_FREEIMAGE) + add_definitions (-DHAVE_FREEIMAGE) +- OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freeimage") ++ find_package(freeimage CONFIG REQUIRED) ++ set(CSF_FreeImagePlus freeimage::FreeImagePlus) + else() + OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREEIMAGE") + OCCT_CHECK_AND_UNSET ("INSTALL_FREEIMAGE") +@@ -730,7 +734,8 @@ endif() + if (NOT DEFINED ANDROID AND CAN_USE_TBB) + if (USE_TBB) + add_definitions (-DHAVE_TBB) +- OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tbb") ++ find_package(TBB CONFIG REQUIRED) ++ set(CSF_TBB TBB::tbb TBB::tbbmalloc) + else() + OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBB") + OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBBMALLOC") +@@ -750,7 +755,8 @@ OCCT_IS_PRODUCT_REQUIRED (CSF_RapidJSON CAN_USE_RAPIDJSON) + if (CAN_USE_RAPIDJSON) + if (USE_RAPIDJSON) + add_definitions (-DHAVE_RAPIDJSON) +- OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/rapidjson") ++ find_package(RapidJSON CONFIG REQUIRED) ++ set(CSF_RapidJSON rapidjson) + else() + OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_RAPIDJSON") + OCCT_CHECK_AND_UNSET ("INSTALL_RAPIDJSON") +diff --git a/adm/cmake/occt_toolkit.cmake b/adm/cmake/occt_toolkit.cmake +index c9399159..f707e00f 100644 +--- a/adm/cmake/occt_toolkit.cmake ++++ b/adm/cmake/occt_toolkit.cmake +@@ -475,11 +475,11 @@ else() + endif() + endif() + +-if (BUILD_SHARED_LIBS OR EXECUTABLE_PROJECT) ++if (1) + if(IS_VTK_9XX) + string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}") + endif() +- target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT}) ++ target_link_libraries (${PROJECT_NAME} PRIVATE ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT}) + endif() + + if (USE_QT) +diff --git a/adm/templates/OpenCASCADEConfig.cmake.in b/adm/templates/OpenCASCADEConfig.cmake.in +index c926c499..3b6db678 100644 +--- a/adm/templates/OpenCASCADEConfig.cmake.in ++++ b/adm/templates/OpenCASCADEConfig.cmake.in +@@ -4,6 +4,22 @@ + # + # This file is configured by OpenCASCADE. + # ++include(CMakeFindDependencyMacro) ++if("@USE_FREEIMAGE@") ++ find_dependency(freeimage CONFIG) ++endif() ++if("@USE_FREETYPE@") ++ find_dependency(Freetype MODULE) ++endif() ++if("@USE_RAPIDJSON@") ++ find_package(RapidJSON CONFIG REQUIRED) ++endif() ++if("@USE_TBB@") ++ find_dependency(TBB CONFIG) ++endif() ++if("@USE_VTK@") ++ find_dependency(VTK REQUIRED) ++endif() + + if(OpenCASCADE_ALREADY_INCLUDED) + return() +diff --git a/src/Standard/Standard_MMgrTBBalloc.cxx b/src/Standard/Standard_MMgrTBBalloc.cxx +index 8c7a2df1..8499e1af 100644 +--- a/src/Standard/Standard_MMgrTBBalloc.cxx ++++ b/src/Standard/Standard_MMgrTBBalloc.cxx +@@ -18,7 +18,6 @@ + + // paralleling with Intel TBB + #ifdef HAVE_TBB +-#pragma comment (lib, "tbbmalloc.lib") + #include + using namespace tbb; + #else diff --git a/ports/opencascade/drop-bin-letter-d.patch b/ports/opencascade/drop-bin-letter-d.patch new file mode 100644 index 00000000000..1e278d523c7 --- /dev/null +++ b/ports/opencascade/drop-bin-letter-d.patch @@ -0,0 +1,45 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d2c4e570..8eac318c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -244,7 +244,6 @@ set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE) + + set (BIN_LETTER "") + if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") +- set (BIN_LETTER "d") + elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") + set (BIN_LETTER "i") + endif() +@@ -917,6 +916,7 @@ if (WIN32) + set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin") + set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bini") + set (CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bind") ++ set (CMAKE_PDB_OUTPUT_DIRECTORY_DEBUG "${CMAKE_BINARY_DIR}/${OS_WITH_BIT}/${COMPILER}/bin") + endif() + + string(TIMESTAMP CURRENT_TIME "%H:%M:%S") +diff --git a/adm/cmake/occt_macros.cmake b/adm/cmake/occt_macros.cmake +index 9fd3ec4c..dc9ff18b 100644 +--- a/adm/cmake/occt_macros.cmake ++++ b/adm/cmake/occt_macros.cmake +@@ -609,7 +609,7 @@ macro (OCCT_INSERT_CODE_FOR_TARGET) + elseif (\"\${CMAKE_INSTALL_CONFIG_NAME}\" MATCHES \"^([Rr][Ee][Ll][Ww][Ii][Tt][Hh][Dd][Ee][Bb][Ii][Nn][Ff][Oo])$\") + set (OCCT_INSTALL_BIN_LETTER \"i\") + elseif (\"\${CMAKE_INSTALL_CONFIG_NAME}\" MATCHES \"^([Dd][Ee][Bb][Uu][Gg])$\") +- set (OCCT_INSTALL_BIN_LETTER \"d\") ++ set (OCCT_INSTALL_BIN_LETTER \"\") + endif()") + endmacro() + +diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt +index beb934f7..95cec74a 100644 +--- a/tools/CMakeLists.txt ++++ b/tools/CMakeLists.txt +@@ -172,7 +172,6 @@ set (CMAKE_INSTALL_PREFIX "${INSTALL_DIR}" CACHE INTERNAL "" FORCE) + + set (BIN_LETTER "") + if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") +- set (BIN_LETTER "d") + elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") + set (BIN_LETTER "i") + endif() diff --git a/ports/opencascade/fix-depend-freetype.patch b/ports/opencascade/fix-depend-freetype.patch deleted file mode 100644 index 4abcddf6db8..00000000000 --- a/ports/opencascade/fix-depend-freetype.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index fbcede5..66b127d 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -563,7 +563,9 @@ if (CAN_USE_FREETYPE) - if (USE_FREETYPE) - message (STATUS "Info: FreeType is used by OCCT") - add_definitions (-DHAVE_FREETYPE) -- OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/freetype") -+ find_package(freetype CONFIG REQUIRED) -+ get_target_property(FREETYPE_INCLUDE_DIR freetype INTERFACE_INCLUDE_DIRECTORIES) -+ list (APPEND 3RDPARTY_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR}") - else() - OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_FREETYPE") - OCCT_CHECK_AND_UNSET ("3RDPARTY_FREETYPE_INCLUDE_DIR_freetype2") diff --git a/ports/opencascade/fix-depend-vtk.patch b/ports/opencascade/fix-depend-vtk.patch deleted file mode 100644 index 26e528def72..00000000000 --- a/ports/opencascade/fix-depend-vtk.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/adm/cmake/vtk.cmake b/adm/cmake/vtk.cmake -index a81cdf9bb2..f265dc3489 100644 ---- a/adm/cmake/vtk.cmake -+++ b/adm/cmake/vtk.cmake -@@ -98,6 +98,11 @@ if (VTK_FOUND) - # get paths from corresponding variables - if (${VTK_LIBRARY}_INCLUDE_DIRS AND EXISTS "${${VTK_LIBRARY}_INCLUDE_DIRS}") - list (APPEND 3RDPARTY_VTK_INCLUDE_DIRS "${${VTK_LIBRARY}_INCLUDE_DIRS}") -+ else() -+ get_target_property(${VTK_LIBRARY}_INCLUDE_DIRS ${VTK_LIBRARY} INTERFACE_INCLUDE_DIRECTORIES) -+ if (${VTK_LIBRARY}_INCLUDE_DIRS AND EXISTS "${${VTK_LIBRARY}_INCLUDE_DIRS}") -+ list (APPEND 3RDPARTY_VTK_INCLUDE_DIRS "${${VTK_LIBRARY}_INCLUDE_DIRS}") -+ endif() - endif() - - if (${VTK_LIBRARY}_LIBRARY_DIRS AND EXISTS "${${VTK_LIBRARY}_LIBRARY_DIRS}") diff --git a/ports/opencascade/fix-dependence.patch b/ports/opencascade/fix-dependence.patch deleted file mode 100644 index d44ce2961d8..00000000000 --- a/ports/opencascade/fix-dependence.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/adm/templates/OpenCASCADEConfig.cmake.in b/adm/templates/OpenCASCADEConfig.cmake.in -index c926c49..a0502cc 100644 ---- a/adm/templates/OpenCASCADEConfig.cmake.in -+++ b/adm/templates/OpenCASCADEConfig.cmake.in -@@ -5,6 +5,8 @@ - # This file is configured by OpenCASCADE. - # - -+include(CMakeFindDependencyMacro) -+ - if(OpenCASCADE_ALREADY_INCLUDED) - return() - endif() -@@ -71,6 +73,16 @@ set (OpenCASCADE_WITH_GLES2 @USE_GLES2@) - @SET_OpenCASCADE_WITH_D3D@ - @SET_OpenCASCADE_WITH_GLX@ - -+if(@USE_FREETYPE@) -+ find_dependency(freetype CONFIG) -+endif() -+ -+find_dependency(OpenGL) -+ -+if(@USE_EIGEN@) -+ find_dependency(Eigen3) -+endif() -+ - # Import OpenCASCADE compile definitions, C and C++ flags for each installed configuration. - file(GLOB CONFIG_FILES "${CMAKE_CURRENT_LIST_DIR}/OpenCASCADECompileDefinitionsAndFlags-*.cmake") - foreach(f ${CONFIG_FILES}) diff --git a/ports/opencascade/fix-find-tbb.patch b/ports/opencascade/fix-find-tbb.patch deleted file mode 100644 index 2732502ac6d..00000000000 --- a/ports/opencascade/fix-find-tbb.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1bacca1a48..9c7d924769 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -731,6 +731,13 @@ endif() - if (NOT DEFINED ANDROID AND CAN_USE_TBB) - if (USE_TBB) - add_definitions (-DHAVE_TBB) -+ if (NOT DEFINED 3RDPARTY_TBB_DIR) -+ find_package(TBB REQUIRED) -+ get_target_property(TBB_INCLUDE_DIR TBB::tbb INTERFACE_INCLUDE_DIRECTORIES) -+ get_filename_component(MY_DIRECTORY ${TBB_INCLUDE_DIR} DIRECTORY) -+ message(STATUS "TBB_INCLUDE_DIR: ${TBB_INCLUDE_DIR} ${TBB_FOUND} ${MY_DIRECTORY}") -+ set(3RDPARTY_TBB_DIR ${MY_DIRECTORY}) -+ endif() - OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/tbb") - else() - OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TBB") diff --git a/ports/opencascade/install-include-dir.patch b/ports/opencascade/install-include-dir.patch index a568ce8aee3..9df3678542e 100644 --- a/ports/opencascade/install-include-dir.patch +++ b/ports/opencascade/install-include-dir.patch @@ -1,17 +1,14 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index f4ec871..59e5134 100644 +index a80e39e6..bb6ab2db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1246,6 +1246,14 @@ foreach (OCCT_MODULE ${OCCT_MODULES}) +@@ -1273,6 +1273,11 @@ foreach (OCCT_MODULE ${OCCT_MODULES}) endforeach() set (OCCT_MODULES_ENABLED ${OCCT_MODULES_ENABLED_SORTED}) -+foreach (OCCT_LIBRARY ${OCCT_LIBRARIES}) -+ target_include_directories( -+ ${OCCT_LIBRARY} -+ INTERFACE -+ $ -+ $) ++foreach (OCCT_LIBRARY IN LISTS OCCT_LIBRARIES) ++ target_include_directories(${OCCT_LIBRARY} INTERFACE $) # OpenCASCADE_INCLUDE_DIR ++ target_include_directories(${OCCT_LIBRARY} INTERFACE $) # vcpkg lock-in +endforeach() + # Add all targets to the build-tree export set diff --git a/ports/opencascade/portfile.cmake b/ports/opencascade/portfile.cmake index 29fbac075a1..cb1b8a8a827 100644 --- a/ports/opencascade/portfile.cmake +++ b/ports/opencascade/portfile.cmake @@ -1,17 +1,16 @@ +string(REPLACE "." "_" VERSION_STR "V${VERSION}") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Open-Cascade-SAS/OCCT - REF cec1ecd0c9f3b3d2572c47035d11949e8dfa85e2 #V7.7.2 - SHA512 2fe98eadd7f9b922729bf80b56f260729d1c257c41392e4be4f070667ee77e94e2b286a873430b41ea61076acf1388aee7ba8b91789aa6199db56066796bb2d3 + REF "${VERSION_STR}" + SHA512 d9e882d44bb65616f8cfce68ebdcd5765669b84e3d82cfb2d1bc22b71b0e878442c079bacc37e9d54f28ce98a7c23bf81f2a3e3e7bbeeec38927ca739f423dee HEAD_REF master PATCHES + dependencies.patch + drop-bin-letter-d.patch fix-pdb-find.patch fix-install-prefix-path.patch install-include-dir.patch - fix-depend-freetype.patch - fix-depend-vtk.patch - fix-dependence.patch - fix-find-tbb.patch ) if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") @@ -22,11 +21,12 @@ endif() vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES - "freeimage" USE_FREEIMAGE - "tbb" USE_TBB - "rapidjson" USE_RAPIDJSON - "samples" INSTALL_SAMPLES - "vtk" USE_VTK + freeimage USE_FREEIMAGE + freetype USE_FREETYPE + rapidjson USE_RAPIDJSON + samples INSTALL_SAMPLES + tbb USE_TBB + vtk USE_VTK ) # 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 @@ -38,12 +38,15 @@ vcpkg_cmake_configure( ${FEATURE_OPTIONS} -DBUILD_LIBRARY_TYPE=${BUILD_TYPE} -DBUILD_MODULE_Draw=OFF - -DINSTALL_DIR_LAYOUT=Unix - -DBUILD_SAMPLES_MFC=OFF - -DBUILD_SAMPLES_QT=OFF -DBUILD_DOC_Overview=OFF - -DINSTALL_TEST_CASES=OFF -DBUILD_MODULE_DETools=OFF + -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 ) vcpkg_cmake_install() @@ -51,73 +54,26 @@ vcpkg_cmake_install() vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/opencascade) #make occt includes relative to source_file -list(APPEND ADDITIONAL_HEADERS - "ExprIntrp.tab.h" - "FlexLexer.h" - "glext.h" - "igesread.h" - "NCollection_Haft.h" - "OSD_PerfMeter.h" - "Standard_values.h" - ) - -file(GLOB files "${CURRENT_PACKAGES_DIR}/include/opencascade/[a-zA-Z0-9_]*\.[hgl]xx") +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") foreach(file_name IN LISTS files) file(READ "${file_name}" filedata) - string(REGEX REPLACE "# *include \<([a-zA-Z0-9_]*\.[hgl]xx)\>" "#include \"\\1\"" filedata "${filedata}") - foreach(extra_header IN LISTS ADDITIONAL_HEADERS) - string(REGEX REPLACE "# *include \<${extra_header}\>" "#include \"${extra_header}\"" filedata "${filedata}") - endforeach() + string(REGEX REPLACE "(# *include) <([a-zA-Z0-9_]*[.][hgl]xx|${extra_headers})>" [[\1 "\2"]] filedata "${filedata}") file(WRITE "${file_name}" "${filedata}") endforeach() -# Remove libd to lib, libd just has cmake files we dont want too -if( WIN32 ) -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib") -file(RENAME "${CURRENT_PACKAGES_DIR}/debug/libd" "${CURRENT_PACKAGES_DIR}/debug/lib") -endif() - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/opencascade/samples/qt") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/trash") -if (NOT VCPKG_BUILD_TYPE) - # fix paths in target files - list(APPEND TARGET_FILES - "${CURRENT_PACKAGES_DIR}/share/opencascade/OpenCASCADEApplicationFrameworkTargets-debug.cmake" - "${CURRENT_PACKAGES_DIR}/share/opencascade/OpenCASCADECompileDefinitionsAndFlags-debug.cmake" - "${CURRENT_PACKAGES_DIR}/share/opencascade/OpenCASCADEDataExchangeTargets-debug.cmake" - "${CURRENT_PACKAGES_DIR}/share/opencascade/OpenCASCADEFoundationClassesTargets-debug.cmake" - "${CURRENT_PACKAGES_DIR}/share/opencascade/OpenCASCADEModelingAlgorithmsTargets-debug.cmake" - "${CURRENT_PACKAGES_DIR}/share/opencascade/OpenCASCADEModelingDataTargets-debug.cmake" - "${CURRENT_PACKAGES_DIR}/share/opencascade/OpenCASCADEVisualizationTargets-debug.cmake" - ) - - foreach(TARGET_FILE IN LISTS TARGET_FILES) - file(READ "${TARGET_FILE}" filedata) - string(REGEX REPLACE "/libd" "/lib" filedata "${filedata}") - string(REGEX REPLACE "/bind" "/bin" filedata "${filedata}") - file(WRITE "${TARGET_FILE}" "${filedata}") - endforeach() - -endif() - -if (VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - # debug creates libd and bind directories that need moving - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin") - file(RENAME "${CURRENT_PACKAGES_DIR}/debug/bind" "${CURRENT_PACKAGES_DIR}/debug/bin") - - # the bin directory ends up with bat files that are noise, let's clean that up - file(GLOB BATS "${CURRENT_PACKAGES_DIR}/bin/*.bat") - file(REMOVE_RECURSE ${BATS}) -else() - # remove scripts in bin dir - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") -endif() - -if (INSTALL_SAMPLES) - foreach(dir "Tutorial" "FuncDemo" "IESample" "OCCTOverview") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/opencascade/samples/qt/${dir}/env.sh" "${CURRENT_PACKAGES_DIR}/bin/env.sh" "") - endforeach() -endif() - -vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/OCCT_LGPL_EXCEPTION.txt") +vcpkg_install_copyright( + FILE_LIST + "${SOURCE_PATH}/LICENSE_LGPL_21.txt" + "${SOURCE_PATH}/OCCT_LGPL_EXCEPTION.txt" +) diff --git a/ports/opencascade/vcpkg.json b/ports/opencascade/vcpkg.json index 4cb456768fc..c4b93778f09 100644 --- a/ports/opencascade/vcpkg.json +++ b/ports/opencascade/vcpkg.json @@ -1,14 +1,20 @@ { "name": "opencascade", "version": "7.7.2", - "port-version": 1, + "port-version": 2, "description": "Open CASCADE Technology (OCCT) is an open-source software development platform for 3D CAD, CAM, CAE.", "homepage": "https://github.com/Open-Cascade-SAS/OCCT", - "license": "LGPL-2.1", - "supports": "!(uwp | xbox | osx | arm)", + "license": "LGPL-2.1-only", + "supports": "!xbox", "dependencies": [ - "fontconfig", - "freetype", + { + "name": "angle", + "platform": "uwp" + }, + { + "name": "opengl", + "platform": "!(android | ios | uwp | wasm32)" + }, { "name": "vcpkg-cmake", "host": true @@ -18,6 +24,12 @@ "host": true } ], + "default-features": [ + { + "name": "freetype", + "platform": "!uwp" + } + ], "features": { "freeimage": { "description": "Enable optional usage of freeimage", @@ -25,6 +37,17 @@ "freeimage" ] }, + "freetype": { + "description": "Use of freetype", + "supports": "!uwp", + "dependencies": [ + "fontconfig", + { + "name": "freetype", + "default-features": false + } + ] + }, "rapidjson": { "description": "Enable optional usage of rapidjson", "dependencies": [ diff --git a/versions/baseline.json b/versions/baseline.json index 1a41341ef6c..2ceef8429e2 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6190,7 +6190,7 @@ }, "opencascade": { "baseline": "7.7.2", - "port-version": 1 + "port-version": 2 }, "opencc": { "baseline": "1.1.6", diff --git a/versions/o-/opencascade.json b/versions/o-/opencascade.json index e591990c202..5d8c462b5d7 100644 --- a/versions/o-/opencascade.json +++ b/versions/o-/opencascade.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "2b1d21c510a4aa414a64ac5e2e46fa0767ff76b1", + "version": "7.7.2", + "port-version": 2 + }, { "git-tree": "8e9c9fb982bef129111ea811c3948ffd570a16dc", "version": "7.7.2",