-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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
- Loading branch information
Showing
11 changed files
with
229 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <tbb/scalable_allocator.h> | ||
using namespace tbb; | ||
#else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.