Skip to content

Commit

Permalink
CMake: add OpenCacade include path when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
HuguesDelorme committed Feb 19, 2024
1 parent 9d67f18 commit 4dc2365
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci_linux_arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
install: |
apt-get -y update
apt-get -y install xvfb # Needed to run unit tests
apt-get -y install cmake
apt-get -y install git
apt-get -y install g++
apt-get -y install qtbase5-dev libqt5svg5-dev
Expand Down
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,16 @@ if(WIN32)
endif()
else()
find_package(OpenCASCADE REQUIRED)
if(OpenCASCADE_FOUND)
# It seems that OpenCascade cmake package files started to add INTERFACE_INCLUDE_DIRECTORIES
# starting from 7.7.0 version
# Older versions require to explicitly add OpenCascade include dir
get_target_property(OpenCASCADE_TKernel_INCLUDE_DIR TKernel INTERFACE_INCLUDE_DIRECTORIES)
list(FIND OpenCASCADE_TKernel_INCLUDE_DIR ${OpenCASCADE_INCLUDE_DIR} OpenCASCADE_TKernel_INCLUDE_DIR_IsSet)
if(OpenCASCADE_TKernel_INCLUDE_DIR_IsSet EQUAL -1)
list(APPEND Mayo_IncludeDirectories ${OpenCASCADE_INCLUDE_DIR})
endif()
endif()
endif()

list(APPEND Mayo_CompileDefinitions OCCT_HANDLE_NOCAST)
Expand Down

0 comments on commit 4dc2365

Please sign in to comment.