Skip to content

Commit bf2c275

Browse files
committed
cmake - fix issue with using cmake occt packages <7.7.0
1 parent deb6243 commit bf2c275

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

cmake/FindOpenCASCADE.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ if(NOT OCC_INCLUDE_DIR AND NOT OCC_LIBRARY_DIR)
3939
mark_as_advanced(OpenCASCADE_DIR)
4040
message(STATUS "Found OpenCASCADE config: ${OpenCASCADE_DIR}")
4141

42+
if(OpenCASCADE_VERSION VERSION_LESS "7.7.0")
43+
# cmake configs < 7.7.0 were not adding include directories to targets automatically.
44+
set_target_properties(TKernel PROPERTIES
45+
INTERFACE_INCLUDE_DIRECTORIES "${OpenCASCADE_INCLUDE_DIR}"
46+
)
47+
endif()
48+
4249
if(OpenCASCADE_VERSION VERSION_LESS "7.9.0")
4350
# Bug in OCCT cmake configs < 7.9.0 - missing linked library.
4451
list(APPEND OpenCASCADE_LIBRARIES WSOCK32.lib)

src/examples/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ if(SCHEMA_VERSIONS MATCHES "2x3")
6565
find_package(CGAL CONFIG REQUIRED)
6666
find_package(OpenCASCADE CONFIG REQUIRED)
6767

68+
if(OpenCASCADE_VERSION VERSION_LESS "7.7.0")
69+
# cmake configs < 7.7.0 were not adding include directories to targets automatically.
70+
set_target_properties(TKernel PROPERTIES
71+
INTERFACE_INCLUDE_DIRECTORIES "${OpenCASCADE_INCLUDE_DIR}"
72+
)
73+
endif()
74+
6875
target_link_libraries(IfcHouseInterface INTERFACE IfcOpenShell::IfcParse IfcOpenShell::geometry_serializer)
6976
else()
7077
target_link_libraries(IfcHouseInterface INTERFACE IfcParse geometry_serializer)

0 commit comments

Comments
 (0)