Salome HOME
Merge from V6_main (04/10/2012)
[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   )
73
74 SET(medpartitionercpp_DEFINITIONS "${HDF5_DEFINITIONS} ${MED3_DEFINITIONS} ${LIBXML_DEFINITIONS} ${MPI_DEFINITIONS}")
75 SET(medpartitionercpp_LDFLAGS
76   ${MED3_LIBS_C_ONLY}
77   ${HDF5_LIBS}
78   ${STDLIB}
79   ${LIBXML_LIBS}
80   ${MPI_LIBS}
81   interpkernel
82   medcoupling
83   medloader
84 )
85 IF(MED_ENABLE_PARMETIS)
86   SET(medpartitionercpp_HEADERS_HXX ${medpartitionercpp_HEADERS_HXX} MEDPARTITIONER_MetisGraph.hxx)
87   SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} MEDPARTITIONER_ParMetisGraph.cxx)
88   SET(medpartitionercpp_DEFINITIONS "${medpartitionercpp_DEFINITIONS} ${PARMETIS_DEFINITIONS}")
89   SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${PARMETIS_LIBS})
90 ELSE(MED_ENABLE_PARMETIS)  
91   IF(MED_ENABLE_METIS)
92     SET(medpartitionercpp_HEADERS_HXX ${medpartitionercpp_HEADERS_HXX} MEDPARTITIONER_MetisGraph.hxx)  
93     SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} MEDPARTITIONER_MetisGraph.cxx)
94     SET(medpartitionercpp_DEFINITIONS "${medpartitionercpp_DEFINITIONS} ${METIS_DEFINITIONS}")
95     SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${METIS_LIBS})
96   ENDIF(MED_ENABLE_METIS)
97   IF(MED_ENABLE_SCOTCH)
98     SET(medpartitionercpp_HEADERS_HXX ${medpartitionercpp_HEADERS_HXX} MEDPARTITIONER_ScotchGraph.hxx)
99     SET(medpartitionercpp_SOURCES ${medpartitionercpp_SOURCES} MEDPARTITIONER_ScotchGraph.cxx)
100     SET(medpartitionercpp_DEFINITIONS "${medpartitionercpp_DEFINITIONS} ${SCOTCH_DEFINITIONS}")
101     SET(medpartitionercpp_LDFLAGS ${medpartitionercpp_LDFLAGS} ${SCOTCH_LIBS})
102   ENDIF(MED_ENABLE_SCOTCH)    
103 ENDIF(MED_ENABLE_PARMETIS)  
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 ELSE(MED_ENABLE_PARMETIS)
123   ADD_EXECUTABLE(medpartitioner medpartitioner.cxx)
124   SET_TARGET_PROPERTIES(medpartitioner PROPERTIES COMPILE_FLAGS "${PLATFORM_DEFINITIONS} ${medpartitionercpp_DEFINITIONS}")
125   TARGET_LINK_LIBRARIES(medpartitioner medpartitionercpp ${medpartitionercpp_LDFLAGS})
126   INSTALL(TARGETS medpartitioner DESTINATION ${MED_salomebin_BINS})
127 ENDIF(MED_ENABLE_PARMETIS)
128
129 INSTALL(FILES ${medpartitionercpp_HEADERS_HXX} DESTINATION ${MED_salomeinclude_HEADERS})