Salome HOME
c82e559be12bbcede4a3e6393b71e5079c19f8af
[tools/medcoupling.git] / src / MEDPartitioner / CMakeLists.txt
1 # Copyright (C) 2007-2012  CEA/DEN, EDF R&D
2 #
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.
7 #
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.
12 #
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
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 ADD_SUBDIRECTORY(Test)
21
22 INCLUDE_DIRECTORIES(
23   ${PARMETIS_INCLUDE_DIRS}
24   ${METIS_INCLUDE_DIRS}
25   ${SCOTCH_INCLUDE_DIRS}
26   ${BOOST_INCLUDE_DIRS}
27   ${METIS_INCLUDE_DIRS}
28   ${LIBXML_INCLUDE_DIRS}
29   ${MED3_INCLUDE_DIRS}
30   ${HDF5_INCLUDE_DIRS}
31   ${MPI_INCLUDE_DIRS}
32   ${CMAKE_CURRENT_SOURCE_DIR}/../MEDLoader
33   ${CMAKE_CURRENT_SOURCE_DIR}/../MEDCoupling
34   ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL
35   ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Bases
36   ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Geometric2D
37   ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/ExprEval
38   ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/GaussPoints
39   )
40
41 SET(medpartitionercpp_HEADERS_HXX
42   MEDPARTITIONER_MeshCollection.hxx
43   MEDPARTITIONER_MeshCollectionDriver.hxx
44   MEDPARTITIONER_MeshCollectionMedXmlDriver.hxx
45   MEDPARTITIONER_MeshCollectionMedAsciiDriver.hxx
46   MEDPARTITIONER_ParallelTopology.hxx
47   MEDPARTITIONER_JointFinder.hxx
48   MEDPARTITIONER_Graph.hxx
49   MEDPARTITIONER_UserGraph.hxx
50   MEDPARTITIONER_Utils.hxx
51   MEDPARTITIONER.hxx
52   MEDPARTITIONER_ParaDomainSelector.hxx
53   MEDPARTITIONER_ConnectZone.hxx
54   MEDPARTITIONER_SkyLineArray.hxx
55   MEDPARTITIONER_Topology.hxx
56   )
57
58 SET(medpartitionercpp_SOURCES
59   MEDPARTITIONER_MeshCollection.cxx
60   MEDPARTITIONER_MeshCollectionDriver.cxx
61   MEDPARTITIONER_MeshCollectionMedXmlDriver.cxx
62   MEDPARTITIONER_MeshCollectionMedAsciiDriver.cxx
63   MEDPARTITIONER_ParallelTopology.cxx
64   MEDPARTITIONER_Graph.cxx
65   MEDPARTITIONER_UserGraph.cxx
66   MEDPARTITIONER_Utils.cxx
67   MEDPARTITIONER_ParaDomainSelector.cxx
68   MEDPARTITIONER_ConnectZone.cxx
69   MEDPARTITIONER_SkyLineArray.cxx
70   )
71
72 SET(medpartitionercpp_DEFINITIONS "${HDF5_DEFINITIONS} ${MED3_DEFINITIONS} ${BOOST_DEFINITIONS} ${LIBXML_DEFINITIONS}")
73 SET(medpartitionercpp_LDFLAGS medloader ${LIBXML_LIBS})
74
75 IF(MED_ENABLE_SCOTCH)
76   SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} MEDPARTITIONER_ScotchGraph.cxx)
77   SET(medpartitionercpp_HEADERS_HXX ${medpartitionercpp_HEADERS_HXX} MEDPARTITIONER_ScotchGraph.hxx)
78   SET(medpartitionercpp_DEFINITIONS "${medpartitionercpp_DEFINITIONS} ${SCOTCH_DEFINITIONS}")
79   SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${SCOTCH_LIBS})
80 ENDIF(MED_ENABLE_SCOTCH)
81
82 IF(MPI_IS_OK)
83   IF(MED_ENABLE_PARMETIS)
84     SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} MEDPARTITIONER_ParMetisGraph.cxx
85       MEDPARTITIONER_UtilsPara.cxx
86       MEDPARTITIONER_JointFinder.cxx
87       )
88     SET(medpartitionercpp_HEADERS_HXX ${medpartitionercpp_HEADERS_HXX} MEDPARTITIONER_JointFinder.hxx MEDPARTITIONER_MetisGraph.hxx)
89     SET(medpartitionercpp_DEFINITIONS "${medpartitionercpp_DEFINITIONS} ${MPI_DEFINITIONS} ${PARMETIS_DEFINITIONS}")
90     SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${PARMETIS_LIBS} ${MPI_LIBS})
91   ELSE(MED_ENABLE_PARMETIS)
92     SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES}
93       MEDPARTITIONER_UtilsPara.cxx
94       MEDPARTITIONER_JointFinder.cxx
95       )
96     SET(medpartitionercpp_DEFINITIONS "${medpartitionercpp_DEFINITIONS} ${MPI_DEFINITIONS}")
97     SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${MPI_LIBS})
98   ENDIF(MED_ENABLE_PARMETIS)
99 ELSE(MPI_IS_OK)
100   IF(MED_ENABLE_METIS)
101     SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} MEDPARTITIONER_MetisGraph.cxx)
102     SET(medpartitionercpp_HEADERS_HXX ${medpartitionercpp_HEADERS_HXX} MEDPARTITIONER_MetisGraph.hxx)
103     SET(medpartitionercpp_DEFINITIONS "${medpartitionercpp_DEFINITIONS} ${METIS_DEFINITIONS}")
104     SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${METIS_LIBS})
105   ENDIF(MED_ENABLE_METIS)
106 ENDIF(MPI_IS_OK)
107
108
109 IF(MPI_IS_OK)
110   ADD_EXECUTABLE(medpartitioner_para medpartitioner_para.cxx)
111   SET_TARGET_PROPERTIES(medpartitioner_para PROPERTIES COMPILE_FLAGS "${medpartitionercpp_DEFINITIONS}")
112   TARGET_LINK_LIBRARIES(medpartitioner_para medpartitionercpp)
113   INSTALL(TARGETS medpartitioner_para DESTINATION ${MED_salomebin_BINS})
114 ELSE(MPI_IS_OK)
115   ADD_EXECUTABLE(medpartitioner medpartitioner.cxx)
116   SET_TARGET_PROPERTIES(medpartitioner PROPERTIES COMPILE_FLAGS "${medpartitionercpp_DEFINITIONS}")
117   TARGET_LINK_LIBRARIES(medpartitioner medpartitionercpp)
118   INSTALL(TARGETS medpartitioner DESTINATION ${MED_salomebin_BINS})
119 ENDIF(MPI_IS_OK)
120
121 ADD_LIBRARY(medpartitionercpp SHARED ${medpartitionercpp_SOURCES})
122 SET_TARGET_PROPERTIES(medpartitionercpp PROPERTIES COMPILE_FLAGS "${medpartitionercpp_DEFINITIONS}")
123 TARGET_LINK_LIBRARIES(medpartitionercpp ${medpartitionercpp_LDFLAGS})
124 INSTALL(TARGETS medpartitionercpp DESTINATION ${MED_salomelib_LIBS})
125
126 INSTALL(FILES ${medpartitionercpp_HEADERS_HXX} DESTINATION ${MED_salomeinclude_HEADERS})