-# Copyright (C) 2007-2012 CEA/DEN, EDF R&D
+# Copyright (C) 2012-2021 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
#
# Author : Anthony Geay (CEA/DEN)
+ADD_DEFINITIONS(${CPPUNIT_DEFINITIONS})
+
INCLUDE_DIRECTORIES(
${CPPUNIT_INCLUDE_DIRS}
${PTHREADS_INCLUDE_DIRS}
MEDCouplingBasicsTest0.cxx
)
+SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
+
ADD_EXECUTABLE(TestMEDCoupling ${TestMEDCoupling_SOURCES})
-SET_TARGET_PROPERTIES(TestMEDCoupling PROPERTIES COMPILE_FLAGS "${CPPUNIT_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
-TARGET_LINK_LIBRARIES(TestMEDCoupling medcoupling ${CPPUNIT_LIBS} ${PLATFORM_LIBS})
+TARGET_LINK_LIBRARIES(TestMEDCoupling medcouplingcpp ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS})
ADD_TEST(TestMEDCoupling TestMEDCoupling)
+SET_TESTS_PROPERTIES(TestMEDCoupling PROPERTIES ENVIRONMENT "${tests_env}")
ADD_EXECUTABLE(TestMEDCouplingRemapper ${TestMEDCouplingRemapper_SOURCES})
-SET_TARGET_PROPERTIES(TestMEDCouplingRemapper PROPERTIES COMPILE_FLAGS "${CPPUNIT_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
-TARGET_LINK_LIBRARIES(TestMEDCouplingRemapper medcouplingremapper ${CPPUNIT_LIBS} ${PLATFORM_LIBS})
+TARGET_LINK_LIBRARIES(TestMEDCouplingRemapper medcouplingremapper ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS})
ADD_TEST(TestMEDCouplingRemapper TestMEDCouplingRemapper)
+SET_TESTS_PROPERTIES(TestMEDCouplingRemapper PROPERTIES ENVIRONMENT "${tests_env}")
ADD_EXECUTABLE(TestMEDCouplingExamples ${TestMEDCouplingExamples_SOURCES})
-SET_TARGET_PROPERTIES(TestMEDCouplingExamples PROPERTIES COMPILE_FLAGS "${CPPUNIT_DEFINITIONS} ${PLATFORM_DEFINITIONS}")
-TARGET_LINK_LIBRARIES(TestMEDCouplingExamples medcoupling ${CPPUNIT_LIBS} ${PLATFORM_LIBS})
+TARGET_LINK_LIBRARIES(TestMEDCouplingExamples medcouplingcpp ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS})
ADD_TEST(TestMEDCouplingExamples TestMEDCouplingExamples)
+SET_TESTS_PROPERTIES(TestMEDCouplingExamples PROPERTIES ENVIRONMENT "${tests_env}")
+
+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_TESTS}/MEDCoupling)
+INSTALL(TARGETS TestMEDCoupling TestMEDCouplingRemapper TestMEDCouplingExamples DESTINATION ${TEST_INSTALL_DIRECTORY})
-INSTALL(TARGETS TestMEDCoupling TestMEDCouplingRemapper DESTINATION ${MED_salomebin_BINS})
+INSTALL(FILES CTestTestfileInstall.cmake
+ DESTINATION ${TEST_INSTALL_DIRECTORY}
+ RENAME CTestTestfile.cmake)