Salome HOME
Merge from V6_main 11/02/2013
[modules/med.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 IF(CPPUNIT_IS_OK)
21   ADD_SUBDIRECTORY(Test)
22 ENDIF(CPPUNIT_IS_OK)
23
24 INCLUDE_DIRECTORIES(
25   ${PARMETIS_INCLUDE_DIRS}
26   ${METIS_INCLUDE_DIRS}
27   ${SCOTCH_INCLUDE_DIRS}
28   ${METIS_INCLUDE_DIRS}
29   ${LIBXML_INCLUDE_DIRS}
30   ${MED3_INCLUDE_DIRS}
31   ${HDF5_INCLUDE_DIRS}
32   ${MPI_INCLUDE_DIRS}
33   ${PTHREADS_INCLUDE_DIRS}
34   ${CMAKE_CURRENT_SOURCE_DIR}/../MEDLoader
35   ${CMAKE_CURRENT_SOURCE_DIR}/../MEDCoupling
36   ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL
37   ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Bases
38   ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Geometric2D
39   ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/ExprEval
40   ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/GaussPoints
41   )
42
43 SET(medpartitionercpp_HEADERS_HXX
44   MEDPARTITIONER_MeshCollection.hxx
45   MEDPARTITIONER_MeshCollectionDriver.hxx
46   MEDPARTITIONER_MeshCollectionMedXmlDriver.hxx
47   MEDPARTITIONER_MeshCollectionMedAsciiDriver.hxx
48   MEDPARTITIONER_ParallelTopology.hxx
49   MEDPARTITIONER_JointFinder.hxx
50   MEDPARTITIONER_Graph.hxx
51   MEDPARTITIONER_UserGraph.hxx
52   MEDPARTITIONER_Utils.hxx
53   MEDPARTITIONER.hxx
54   MEDPARTITIONER_ParaDomainSelector.hxx
55   MEDPARTITIONER_ConnectZone.hxx
56   MEDPARTITIONER_SkyLineArray.hxx
57   MEDPARTITIONER_Topology.hxx
58   )
59
60 SET(medpartitionercpp_SOURCES
61   MEDPARTITIONER_MeshCollection.cxx
62   MEDPARTITIONER_MeshCollectionDriver.cxx
63   MEDPARTITIONER_MeshCollectionMedXmlDriver.cxx
64   MEDPARTITIONER_MeshCollectionMedAsciiDriver.cxx
65   MEDPARTITIONER_ParallelTopology.cxx
66   MEDPARTITIONER_Graph.cxx
67   MEDPARTITIONER_UserGraph.cxx
68   MEDPARTITIONER_Utils.cxx
69   MEDPARTITIONER_ParaDomainSelector.cxx
70   MEDPARTITIONER_ConnectZone.cxx
71   MEDPARTITIONER_SkyLineArray.cxx
72   MEDPARTITIONER_metis.c
73   )
74
75 SET(medpartitionercpp_DEFINITIONS "${HDF5_DEFINITIONS} ${MED3_DEFINITIONS} ${LIBXML_DEFINITIONS} ${MPI_DEFINITIONS}")
76 SET(medpartitionercpp_LDFLAGS
77   ${MED3_LIBS_C_ONLY}
78   ${HDF5_LIBS}
79   ${STDLIB}
80   ${LIBXML_LIBS}
81   ${MPI_LIBS}
82   interpkernel
83   medcoupling
84   medloader
85 )
86 IF(MED_ENABLE_PARMETIS)
87   SET(medpartitionercpp_HEADERS_HXX ${medpartitionercpp_HEADERS_HXX} MEDPARTITIONER_ParMetisGraph.hxx)
88   SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} MEDPARTITIONER_ParMetisGraph.cxx)
89   SET(medpartitionercpp_DEFINITIONS "${medpartitionercpp_DEFINITIONS} ${PARMETIS_DEFINITIONS}")
90   SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${PARMETIS_LIBS})
91 ENDIF(MED_ENABLE_PARMETIS)
92 IF(MED_ENABLE_METIS)
93   SET(medpartitionercpp_HEADERS_HXX ${medpartitionercpp_HEADERS_HXX} MEDPARTITIONER_MetisGraph.hxx)
94   SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} MEDPARTITIONER_MetisGraph.cxx)
95   SET(medpartitionercpp_DEFINITIONS "${medpartitionercpp_DEFINITIONS} ${METIS_DEFINITIONS}")
96   SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${METIS_LIBS})
97 ENDIF(MED_ENABLE_METIS)
98 IF(MED_ENABLE_SCOTCH)
99   SET(medpartitionercpp_HEADERS_HXX ${medpartitionercpp_HEADERS_HXX} MEDPARTITIONER_ScotchGraph.hxx)
100   SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} MEDPARTITIONER_ScotchGraph.cxx)
101   SET(medpartitionercpp_DEFINITIONS "${medpartitionercpp_DEFINITIONS} ${SCOTCH_DEFINITIONS}")
102   SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${SCOTCH_LIBS})
103 ENDIF(MED_ENABLE_SCOTCH)
104
105 IF(MPI_IS_OK)
106   SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES}
107     MEDPARTITIONER_UtilsPara.cxx
108     MEDPARTITIONER_JointFinder.cxx
109   )
110 ENDIF(MPI_IS_OK)                          
111   
112 ADD_LIBRARY(medpartitionercpp SHARED ${medpartitionercpp_SOURCES})
113 SET_TARGET_PROPERTIES(medpartitionercpp PROPERTIES COMPILE_FLAGS "${PLATFORM_DEFINITIONS} ${medpartitionercpp_DEFINITIONS}")
114 TARGET_LINK_LIBRARIES(medpartitionercpp ${medpartitionercpp_LDFLAGS} ${PLATFORM_LIBS} ${PTHREAD_LIBS})
115 INSTALL(TARGETS medpartitionercpp DESTINATION ${MED_salomelib_LIBS})
116   
117 IF(MED_ENABLE_PARMETIS)
118   ADD_EXECUTABLE(medpartitioner_para medpartitioner_para.cxx)
119   SET_TARGET_PROPERTIES(medpartitioner_para PROPERTIES COMPILE_FLAGS "${medpartitionercpp_DEFINITIONS}")
120   TARGET_LINK_LIBRARIES(medpartitioner_para medpartitionercpp ${medpartitionercpp_LDFLAGS})
121   INSTALL(TARGETS medpartitioner_para DESTINATION ${MED_salomebin_BINS})
122 ENDIF(MED_ENABLE_PARMETIS)
123
124 ADD_EXECUTABLE(medpartitioner medpartitioner.cxx)
125 SET_TARGET_PROPERTIES(medpartitioner PROPERTIES COMPILE_FLAGS "${PLATFORM_DEFINITIONS} ${medpartitionercpp_DEFINITIONS}")
126 TARGET_LINK_LIBRARIES(medpartitioner medpartitionercpp ${medpartitionercpp_LDFLAGS})
127 INSTALL(TARGETS medpartitioner DESTINATION ${MED_salomebin_BINS})
128
129 INSTALL(FILES ${medpartitionercpp_HEADERS_HXX} DESTINATION ${MED_salomeinclude_HEADERS})