forked from FreeCAD/FreeCAD
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathFindSMESH.cmake
70 lines (64 loc) · 2.08 KB
/
FindSMESH.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Try to find Salome SMESH
# Once done this will define
#
# SMESH_FOUND - system has Salome SMESH
# SMESH_INCLUDE_DIR - where the Salome SMESH include directory can be found
# SMESH_LIBRARIES - Link this to use Salome SMESH
#
# SMESH needs VTK
find_package(VTK REQUIRED)
# If this definition is not set, linker errors will occur against SMESH on 64 bit machines.
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_definitions(-DSALOME_USE_64BIT_IDS)
endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
IF (CMAKE_COMPILER_IS_GNUCC)
FIND_PATH(SMESH_INCLUDE_DIR SMESH_Mesh.hxx
# These are default search paths, why specify them?
PATH_SUFFIXES smesh SMESH smesh/SMESH
)
FIND_LIBRARY(SMESH_LIBRARY SMESH)
ELSE (CMAKE_COMPILER_IS_GNUCC)
# Not yet implemented
ENDIF (CMAKE_COMPILER_IS_GNUCC)
IF(SMESH_INCLUDE_DIR)
SET(SMESH_INC_ROOT "${SMESH_INCLUDE_DIR}/..")
# Append extra include dirs
SET(SMESH_INCLUDE_DIR
"${SMESH_INCLUDE_DIR};
${SMESH_INC_ROOT}/Controls;
${SMESH_INC_ROOT}/Driver;
${SMESH_INC_ROOT}/DriverDAT;
${SMESH_INC_ROOT}/DriverGMF;
${SMESH_INC_ROOT}/DriverSTL;
${SMESH_INC_ROOT}/DriverUNV;
${SMESH_INC_ROOT}/Geom;
${SMESH_INC_ROOT}/Kernel;
${SMESH_INC_ROOT}/MEFISTO2;
${SMESH_INC_ROOT}/MeshVSLink;
${SMESH_INC_ROOT}/Netgen;
${SMESH_INC_ROOT}/NETGENPlugin;
${SMESH_INC_ROOT}/SMDS;
${SMESH_INC_ROOT}/SMESHDS;
${SMESH_INC_ROOT}/SMESHUtils;
${SMESH_INC_ROOT}/StdMeshers;")
ELSE(SMESH_INCLUDE_DIR)
message(FATAL_ERROR "SMESH include directories not found!")
ENDIF(SMESH_INCLUDE_DIR)
SET(SMESH_FOUND FALSE)
IF(SMESH_LIBRARY)
SET(SMESH_FOUND TRUE)
GET_FILENAME_COMPONENT(SMESH_LIBRARY_DIR ${SMESH_LIBRARY} PATH)
set(SMESH_LIBRARIES
${SMESH_LIBRARY_DIR}/libDriver.so
${SMESH_LIBRARY_DIR}/libDriverDAT.so
${SMESH_LIBRARY_DIR}/libDriverSTL.so
${SMESH_LIBRARY_DIR}/libDriverUNV.so
${SMESH_LIBRARY_DIR}/libSMDS.so
${SMESH_LIBRARY_DIR}/libSMESH.so
${SMESH_LIBRARY_DIR}/libSMESHDS.so
${SMESH_LIBRARY_DIR}/libStdMeshers.so
)
set(EXTERNAL_SMESH_LIBS ${SMESH_LIBRARIES})
ELSE(SMESH_LIBRARY)
message(FATAL_ERROR "SMESH libraries NOT FOUND!")
ENDIF(SMESH_LIBRARY)