Salome HOME
Merge branch 'agr/medcoupling_tool'
[tools/medcoupling.git] / src / MEDCoupling / Test / CMakeLists.txt
index c5b2385ee52e473a0e3ca291eb7f3d36edaf6c82..89e65948e0048dbb41250f9762af7ee00c4984d6 100644 (file)
@@ -1,9 +1,9 @@
-# Copyright (C) 2007-2012  CEA/DEN, EDF R&D
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 # License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
 #
 # This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 #
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
+# Author : Anthony Geay (CEA/DEN)
+
+ADD_DEFINITIONS(${CPPUNIT_DEFINITIONS})
 
 INCLUDE_DIRECTORIES(
-  $(CPPUNIT_INCLUDE_DIRS)
+  ${CPPUNIT_INCLUDE_DIRS}
+  ${PTHREADS_INCLUDE_DIRS}
   ${CMAKE_CURRENT_SOURCE_DIR}/..
   ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL
   ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL/Bases
@@ -51,18 +55,26 @@ SET(TestMEDCouplingExamples_SOURCES
   )
 
 ADD_EXECUTABLE(TestMEDCoupling ${TestMEDCoupling_SOURCES})
-SET_TARGET_PROPERTIES(TestMEDCoupling PROPERTIES COMPILE_FLAGS "${CPPUNIT_DEFINITIONS}")
-TARGET_LINK_LIBRARIES(TestMEDCoupling medcoupling ${CPPUNIT_LIBS})
+TARGET_LINK_LIBRARIES(TestMEDCoupling medcoupling ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS})
 ADD_TEST(TestMEDCoupling TestMEDCoupling)
 
 ADD_EXECUTABLE(TestMEDCouplingRemapper ${TestMEDCouplingRemapper_SOURCES})
-SET_TARGET_PROPERTIES(TestMEDCouplingRemapper PROPERTIES COMPILE_FLAGS "${CPPUNIT_DEFINITIONS}")
-TARGET_LINK_LIBRARIES(TestMEDCouplingRemapper medcouplingremapper ${CPPUNIT_LIBS})
+TARGET_LINK_LIBRARIES(TestMEDCouplingRemapper medcouplingremapper ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS})
 ADD_TEST(TestMEDCouplingRemapper TestMEDCouplingRemapper)
 
 ADD_EXECUTABLE(TestMEDCouplingExamples ${TestMEDCouplingExamples_SOURCES})
-SET_TARGET_PROPERTIES(TestMEDCouplingExamples PROPERTIES COMPILE_FLAGS "${CPPUNIT_DEFINITIONS}")
-TARGET_LINK_LIBRARIES(TestMEDCouplingExamples medcoupling ${CPPUNIT_LIBS})
+TARGET_LINK_LIBRARIES(TestMEDCouplingExamples medcoupling ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS})
 ADD_TEST(TestMEDCouplingExamples TestMEDCouplingExamples)
 
-INSTALL(TARGETS TestMEDCoupling TestMEDCouplingRemapper DESTINATION ${MED_salomebin_BINS})
+INSTALL(TARGETS TestMEDCoupling TestMEDCouplingRemapper TestMEDCouplingExamples DESTINATION ${MEDCOUPLING_INSTALL_BINS})
+
+SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES UnitTestsResult)
+
+# Application tests
+
+SET(TEST_INSTALL_DIRECTORY ${MEDCOUPLING_INSTALL_SCRIPT_SCRIPTS}/test/MEDCoupling/MEDCoupling)
+INSTALL(TARGETS TestMEDCoupling TestMEDCouplingRemapper TestMEDCouplingExamples DESTINATION ${TEST_INSTALL_DIRECTORY})
+
+INSTALL(FILES CTestTestfileInstall.cmake
+        DESTINATION ${TEST_INSTALL_DIRECTORY}
+        RENAME CTestTestfile.cmake)