vcpkg/ports/opencascade/dependencies.patch
Kai Pastor 11cbb6b57b
[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
2023-11-21 19:51:11 -08:00

113 lines
3.7 KiB
Diff

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 <tbb/scalable_allocator.h>
using namespace tbb;
#else