From a02ef95400c4dfb6bddf9b4eb498e108abba0527 Mon Sep 17 00:00:00 2001 From: LilyWangLL <94091114+LilyWangLL@users.noreply.github.com> Date: Tue, 10 May 2022 05:12:27 +0800 Subject: [PATCH] [opencascade] Fix link the debug of freetype.dll (#23939) * [opencascade] Fix link the debug of freetype.dll * update version * fix build error * update version * update patch * update version Co-authored-by: Lily Wang --- ports/opencascade/fix-depend-freetype.patch | 15 +++++++++++++ ports/opencascade/portfile.cmake | 25 +++++++++++---------- ports/opencascade/vcpkg.json | 2 ++ versions/baseline.json | 2 +- versions/o-/opencascade.json | 5 +++++ 5 files changed, 36 insertions(+), 13 deletions(-) create mode 100644 ports/opencascade/fix-depend-freetype.patch diff --git a/ports/opencascade/fix-depend-freetype.patch b/ports/opencascade/fix-depend-freetype.patch new file mode 100644 index 0000000000..b37b7ee4e0 --- /dev/null +++ b/ports/opencascade/fix-depend-freetype.patch @@ -0,0 +1,15 @@ +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/portfile.cmake b/ports/opencascade/portfile.cmake index a1f7e439d9..b10642345d 100644 --- a/ports/opencascade/portfile.cmake +++ b/ports/opencascade/portfile.cmake @@ -8,6 +8,7 @@ vcpkg_from_github( fix-pdb-find.patch fix-install-prefix-path.patch install-include-dir.patch + fix-depend-freetype.patch ) if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) @@ -49,22 +50,22 @@ 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" + "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") 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() - file(WRITE "${file_name}" "${filedata}") + 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() + file(WRITE "${file_name}" "${filedata}") endforeach() # Remove libd to lib, libd just has cmake files we dont want too diff --git a/ports/opencascade/vcpkg.json b/ports/opencascade/vcpkg.json index ea7ddba296..d06977325c 100644 --- a/ports/opencascade/vcpkg.json +++ b/ports/opencascade/vcpkg.json @@ -1,8 +1,10 @@ { "name": "opencascade", "version": "7.6.0", + "port-version": 1, "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 | osx | linux | arm)", "dependencies": [ "freetype", diff --git a/versions/baseline.json b/versions/baseline.json index c799f509de..43352a62cb 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5066,7 +5066,7 @@ }, "opencascade": { "baseline": "7.6.0", - "port-version": 0 + "port-version": 1 }, "opencc": { "baseline": "2020-04-26", diff --git a/versions/o-/opencascade.json b/versions/o-/opencascade.json index 4c4df69f2a..c82c8c0f97 100644 --- a/versions/o-/opencascade.json +++ b/versions/o-/opencascade.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "0b043af5fd55a990d23a36523c82b005422ba75c", + "version": "7.6.0", + "port-version": 1 + }, { "git-tree": "a1f9f32c2e0778573a20d4b59fda9be37cf6134d", "version": "7.6.0",