1 # Copyright (C) 2012-2013 CEA/DEN, EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 ADD_DEFINITIONS(${HDF5_DEFINITIONS} ${MEDFILE_DEFINITIONS} ${LIBXML2_DEFINITIONS})
23 ${LIBXML2_INCLUDE_DIR}
24 ${MEDFILE_INCLUDE_DIRS}
26 ${PTHREADS_INCLUDE_DIRS}
27 ${CMAKE_CURRENT_SOURCE_DIR}/../MEDLoader
28 ${CMAKE_CURRENT_SOURCE_DIR}/../MEDCoupling
29 ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL
30 ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Bases
31 ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Geometric2D
32 ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/ExprEval
33 ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/GaussPoints
36 IF(SALOME_MED_PARTITIONER_METIS)
37 ADD_DEFINITIONS(${METIS_DEFINITIONS})
38 ADD_DEFINITIONS("-DMED_ENABLE_METIS")
39 INCLUDE_DIRECTORIES(${METIS_INCLUDE_DIRS})
40 ENDIF(SALOME_MED_PARTITIONER_METIS)
44 # VERY IMPORTANT PUT METIS BEFORE SCOTCH because
45 # metis.h is also in SCOTCH install dir !!!
47 IF(SALOME_MED_PARTITIONER_SCOTCH)
48 ADD_DEFINITIONS(${SCOTCH_DEFINITIONS})
49 ADD_DEFINITIONS("-DMED_ENABLE_SCOTCH")
50 INCLUDE_DIRECTORIES(${SCOTCH_INCLUDE_DIRS})
51 ENDIF(SALOME_MED_PARTITIONER_SCOTCH)
53 IF(SALOME_MED_PARTITIONER_PARMETIS)
54 ADD_DEFINITIONS(${PARMETIS_DEFINITIONS})
55 ADD_DEFINITIONS("-DMED_ENABLE_PARMETIS")
56 ADD_DEFINITIONS("-DMED_ENABLE_METIS")
57 INCLUDE_DIRECTORIES(${PARMETIS_INCLUDE_DIRS})
58 ENDIF(SALOME_MED_PARTITIONER_PARMETIS)
61 ADD_DEFINITIONS(${MPI_DEFINITIONS})
62 ADD_DEFINITIONS("-DHAVE_MPI2")
63 INCLUDE_DIRECTORIES(${MPI_INCLUDE_DIRS})
66 IF(SALOME_BUILD_TESTS)
67 ADD_SUBDIRECTORY(Test)
68 ENDIF(SALOME_BUILD_TESTS)
70 SET(medpartitionercpp_HEADERS_HXX
71 MEDPARTITIONER_MeshCollection.hxx
72 MEDPARTITIONER_MeshCollectionDriver.hxx
73 MEDPARTITIONER_MeshCollectionMedXmlDriver.hxx
74 MEDPARTITIONER_MeshCollectionMedAsciiDriver.hxx
75 MEDPARTITIONER_ParallelTopology.hxx
76 MEDPARTITIONER_JointFinder.hxx
77 MEDPARTITIONER_Graph.hxx
78 MEDPARTITIONER_UserGraph.hxx
79 MEDPARTITIONER_Utils.hxx
81 MEDPARTITIONER_ParaDomainSelector.hxx
82 MEDPARTITIONER_ConnectZone.hxx
83 MEDPARTITIONER_SkyLineArray.hxx
84 MEDPARTITIONER_Topology.hxx
87 SET(medpartitionercpp_SOURCES
88 MEDPARTITIONER_MeshCollection.cxx
89 MEDPARTITIONER_MeshCollectionDriver.cxx
90 MEDPARTITIONER_MeshCollectionMedXmlDriver.cxx
91 MEDPARTITIONER_MeshCollectionMedAsciiDriver.cxx
92 MEDPARTITIONER_ParallelTopology.cxx
93 MEDPARTITIONER_Graph.cxx
94 MEDPARTITIONER_UserGraph.cxx
95 MEDPARTITIONER_Utils.cxx
96 MEDPARTITIONER_ParaDomainSelector.cxx
97 MEDPARTITIONER_ConnectZone.cxx
98 MEDPARTITIONER_SkyLineArray.cxx
99 MEDPARTITIONER_metis.c
102 SET(medpartitionercpp_LDFLAGS
103 ${MEDFILE_C_LIBRARIES}
111 IF(SALOME_MED_PARTITIONER_PARMETIS)
112 SET(medpartitionercpp_HEADERS_HXX ${medpartitionercpp_HEADERS_HXX} MEDPARTITIONER_ParMetisGraph.hxx)
113 SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} MEDPARTITIONER_ParMetisGraph.cxx MEDPARTITIONER_MetisGraph.cxx)
114 SET(medpartitionercpp_DEFINITIONS "${medpartitionercpp_DEFINITIONS} ${PARMETIS_DEFINITIONS}")
115 SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${PARMETIS_LIBRARIES})
116 ENDIF(SALOME_MED_PARTITIONER_PARMETIS)
117 IF(SALOME_MED_PARTITIONER_METIS)
118 SET(medpartitionercpp_HEADERS_HXX ${medpartitionercpp_HEADERS_HXX} MEDPARTITIONER_MetisGraph.hxx)
119 SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} MEDPARTITIONER_MetisGraph.cxx)
120 SET(medpartitionercpp_DEFINITIONS "${medpartitionercpp_DEFINITIONS} ${METIS_DEFINITIONS}")
121 SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${METIS_LIBRARIES})
122 ENDIF(SALOME_MED_PARTITIONER_METIS)
123 IF(SALOME_MED_PARTITIONER_SCOTCH)
124 SET(medpartitionercpp_HEADERS_HXX ${medpartitionercpp_HEADERS_HXX} MEDPARTITIONER_ScotchGraph.hxx)
125 SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} MEDPARTITIONER_ScotchGraph.cxx)
126 SET(medpartitionercpp_DEFINITIONS "${medpartitionercpp_DEFINITIONS} ${SCOTCH_DEFINITIONS}")
127 SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${SCOTCH_LIBRARIES})
128 ENDIF(SALOME_MED_PARTITIONER_SCOTCH)
130 IF(${SALOME_USE_MPI})
131 SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} MEDPARTITIONER_UtilsPara.cxx MEDPARTITIONER_JointFinder.cxx)
132 ADD_EXECUTABLE(medpartitioner_para medpartitioner_para.cxx)
133 SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${MPI_LIBRARIES})
134 SET_TARGET_PROPERTIES(medpartitioner_para PROPERTIES COMPILE_FLAGS "${medpartitionercpp_DEFINITIONS}")
135 TARGET_LINK_LIBRARIES(medpartitioner_para medpartitionercpp ${medpartitionercpp_LDFLAGS})
136 INSTALL(TARGETS medpartitioner_para DESTINATION ${SALOME_INSTALL_BINS})
137 ENDIF(${SALOME_USE_MPI})
139 ADD_LIBRARY(medpartitionercpp SHARED ${medpartitionercpp_SOURCES})
140 SET_TARGET_PROPERTIES(medpartitionercpp PROPERTIES COMPILE_FLAGS "${PLATFORM_DEFINITIONS} ${medpartitionercpp_DEFINITIONS}")
141 TARGET_LINK_LIBRARIES(medpartitionercpp ${medpartitionercpp_LDFLAGS} ${PLATFORM_LIBS} ${PTHREAD_LIBS})
142 INSTALL(TARGETS medpartitionercpp DESTINATION ${SALOME_INSTALL_LIBS})
144 ADD_EXECUTABLE(medpartitioner medpartitioner.cxx)
145 SET_TARGET_PROPERTIES(medpartitioner PROPERTIES COMPILE_FLAGS "${PLATFORM_DEFINITIONS} ${medpartitionercpp_DEFINITIONS}")
146 TARGET_LINK_LIBRARIES(medpartitioner medpartitionercpp ${medpartitionercpp_LDFLAGS})
147 INSTALL(TARGETS medpartitioner DESTINATION ${SALOME_INSTALL_BINS})
149 INSTALL(FILES ${medpartitionercpp_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS})