Salome HOME
14a9799e67b35e57a8e1ff65097599465ae45e4d
[tools/medcoupling.git] / src / MEDPartitioner / Test / CMakeLists.txt
1 # Copyright (C) 2012-2016  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, or (at your option) any later version.
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_DEFINITIONS(${BOOST_DEFINITIONS} ${CPPUNIT_DEFINITIONS})
21
22 INCLUDE_DIRECTORIES(
23   ${CPPUNIT_INCLUDE_DIRS}
24   ${CMAKE_CURRENT_SOURCE_DIR}/..
25   ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNELTest # for BasicMainTest.hxx
26   )
27
28 SET(MEDPARTITIONERTest_HEADERS_HXX
29   MEDPARTITIONERTest.hxx
30   )
31
32 SET(MEDPARTITIONERTest_SOURCES
33   MEDPARTITIONERTest.cxx
34   )
35
36 SET(MEDPARTITIONERTest_LDFLAGS medpartitionercpp ${CPPUNIT_LIBRARIES})
37
38 IF(MEDCOUPLING_USE_MPI)
39   IF(MEDCOUPLING_PARTITIONER_PARMETIS)
40     SET(MEDPARTITIONERTest_SOURCES ${MEDPARTITIONERTest_SOURCES} MEDPARTITIONERTestPara.cxx)
41   ENDIF(MEDCOUPLING_PARTITIONER_PARMETIS)
42 ENDIF(MEDCOUPLING_USE_MPI)
43
44 ADD_LIBRARY(MEDPARTITIONERTest ${MEDPARTITIONERTest_SOURCES})
45 TARGET_LINK_LIBRARIES(MEDPARTITIONERTest ${MEDPARTITIONERTest_LDFLAGS})
46 INSTALL(TARGETS MEDPARTITIONERTest DESTINATION ${MEDCOUPLING_INSTALL_LIBS})
47
48 ADD_EXECUTABLE(TestMEDPARTITIONER TestMEDPARTITIONER.cxx)
49 TARGET_LINK_LIBRARIES(TestMEDPARTITIONER MEDPARTITIONERTest)
50 INSTALL(TARGETS TestMEDPARTITIONER DESTINATION ${MEDCOUPLING_INSTALL_BINS})
51
52 INSTALL(FILES ${MEDPARTITIONERTest_HEADERS_HXX} DESTINATION ${MEDCOUPLING_INSTALL_HEADERS})
53
54 SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
55 ADD_TEST(TestMEDPARTITIONER TestMEDPARTITIONER)
56 SET_TESTS_PROPERTIES(TestMEDPARTITIONER PROPERTIES ENVIRONMENT "${tests_env}")
57
58 # Application tests
59
60 SET(TEST_INSTALL_DIRECTORY ${MEDCOUPLING_INSTALL_TESTS}/MEDPartitioner)
61 INSTALL(TARGETS MEDPARTITIONERTest TestMEDPARTITIONER DESTINATION ${TEST_INSTALL_DIRECTORY})
62
63 INSTALL(FILES CTestTestfileInstall.cmake
64         DESTINATION ${TEST_INSTALL_DIRECTORY}
65         RENAME CTestTestfile.cmake)