-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathFindSIMMETRIX.cmake
74 lines (60 loc) · 2.28 KB
/
FindSIMMETRIX.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
70
71
72
73
74
include(FindPackageHandleStandardArgs)
find_path(GMI_SIM_INCLUDE_DIR gmi_sim.h)
find_path(APF_SIM_INCLUDE_DIR apfSIM.h)
find_path(MESH_SIM_INCLUDE_DIR MeshSim.h)
list(APPEND SIMMETRIX_INCLUDE_DIR
${GMI_SIM_INCLUDE_DIR}
${APF_SIM_INCLUDE_DIR}
${MESH_SIM_INCLUDE_DIR}
)
find_library(GMI_SIM_LIB gmi_sim)
find_library(APF_SIM_LIB apf_sim)
message(SIMMETRIX_ROOT : ${SIMMETRIX_ROOT})
set(SIM_LIB_HINT ${SIMMETRIX_ROOT}/lib/x64_rhel8_gcc83)
find_library(SIM_DISCRETE_LIB SimDiscrete ${SIM_LIB_HINT})
find_library(SIM_MESHING_LIB SimMeshing ${SIM_LIB_HINT})
find_library(SIM_MESH_TOOLS_LIB SimMeshTools ${SIM_LIB_HINT})
find_library(SIM_MODEL_LIB SimModel ${SIM_LIB_HINT})
if (PARASOLID)
find_library(SIM_PARASOLID_LIB NAMES SimParasolid310 SimParasolid320 SimParasolid330 PATHS ${SIM_LIB_HINT})
endif()
find_library(SIM_PARTITIONED_MESH_LIB SimPartitionedMesh ${SIM_LIB_HINT})
find_library(SIM_PARTITIONED_MESH_MPI_LIB SimPartitionedMesh-mpi ${SIM_LIB_HINT})
find_library(SIM_PARTITINED_WRAPPER_LIB SimPartitionWrapper-${SIM_MPI} ${SIM_LIB_HINT})
find_library(SIM_PS_KRNL_LIB pskernel ${SIM_LIB_HINT}/psKrnl)
find_library(SIM_LICENSE_LIB SimLicense ${SIM_LIB_HINT})
get_filename_component(SIM_PS_KRNL_LIB_DIR ${SIM_PS_KRNL_LIB} DIRECTORY)
list(APPEND SIMMETRIX_LIBRARIES
"${GMI_SIM_LIB}"
"${APF_SIM_LIB}"
"${SIM_DISCRETE_LIB}"
"${SIM_EXPORT_LIB}"
"${SIM_MESHING_LIB}"
"${SIM_MESH_TOOLS_LIB}"
"${SIM_PARTITIONED_MESH_MPI_LIB}"
"${SIM_PARTITINED_WRAPPER_LIB}"
"${SIM_MODEL_LIB}"
"${SIM_PS_KRNL_LIB}"
"${SIM_LICENSE_LIB}"
)
if (PARASOLID)
list(APPEND SIMMETRIX_LIBRARIES
"${SIM_PARASOLID_LIB}"
)
endif()
# Workaround for Fedora:
# Needs to manually link with TIRPC
# Optional on most other distributions!
find_library(TIRPC tirpc)
if (TIRPC)
list(APPEND SIMMETRIX_LIBRARIES ${TIRPC})
endif()
message(SIM_MODEL_LIB : ${SIM_MODEL_LIB})
string(REGEX REPLACE ".*/([0-9]+).[0-9]-.*" "\\1" SIM_MAJOR_VER ${SIM_MODEL_LIB})
message(SIM_MAJOR_VER : ${SIM_MAJOR_VER})
message(SIMMETRIX : ${SIMMETRIX})
message(SIMMETRIX_INCLUDE_DIR : ${SIMMETRIX_INCLUDE_DIR})
message(SIMMETRIX_LIBRARIES : ${SIMMETRIX_LIBRARIES})
find_package_handle_standard_args(SIMMETRIX DEFAULT_MSG
SIMMETRIX_INCLUDE_DIR SIMMETRIX_LIBRARIES SIM_MAJOR_VER)
mark_as_advanced(SIMMETRIX_INCLUDE_DIR SIMMETRIX_LIBRARIES SIM_MAJOR_VER)