-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfindOpenCascade.cmake
34 lines (30 loc) · 1.02 KB
/
findOpenCascade.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
### EGADS ###
FIND_LIBRARY(EGADS_LIBRARY
NAMES
egads
HINTS
${CMAKE_FIND_ROOT_PATH}
${PETSc_LIBRARY_DIRS}
PATHS
${CMAKE_FIND_ROOT_PATH}
${PETSc_LIBRARY_DIRS}
)
if(NOT EGADS_LIBRARY)
message(FATAL_ERROR "Cannot find EGADS library. Please reconfigure PETSc with --download-egads flag." )
else()
add_library(EGADS::EGADS UNKNOWN IMPORTED)
set_target_properties(
EGADS::EGADS
PROPERTIES
IMPORTED_LOCATION ${EGADS_LIBRARY})
endif()
target_link_libraries(example PUBLIC EGADS::EGADS)
### OpenCASCADE ###
# OpenCASCADE should be built with petsc
FIND_PACKAGE(OpenCASCADE CONFIG REQUIRED HINTS "$ENV{PETSC_DIR}/$ENV{PETSC_ARCH}/lib/cmake/opencascade/")
target_link_libraries(example PUBLIC ${OpenCASCADE_LIBRARIES})
target_link_directories(example PUBLIC ${OpenCASCADE_LIBRARY_DIR})
### Load in threads ###
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(example PUBLIC Threads::Threads)