1 # Copyright (C) 2012-2023 CEA, EDF
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.
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.
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
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 # TODO : URANIE AND WIN32 : to compile on Windows, user uranietm
24 # To adapt when YACS will be available on Windows
28 # Find the CppUnit includes and library
31 # CPPUNIT_INCLUDE_DIR, where to find tiff.h, etc.
32 # CPPUNIT_LIBRARIES, the libraries to link against to use CppUnit.
33 # CPPUNIT_FOUND, If false, do not try to use CppUnit.
35 # also defined, but not for general use are
36 # CPPUNIT_LIBRARY, where to find the CppUnit library.
37 # CPPUNIT_DEBUG_LIBRARY, where to find the CppUnit library in debug mode.
39 FIND_PATH(CPPUNIT_INCLUDE_DIR cppunit/TestCase.h)
41 # With Win32, important to have both
43 FIND_LIBRARY(CPPUNIT_LIBRARY cppunit
44 ${CPPUNIT_INCLUDE_DIR}/../lib)
45 FIND_LIBRARY(CPPUNIT_DEBUG_LIBRARY cppunitd
46 ${CPPUNIT_INCLUDE_DIR}/../lib)
48 IF(CPPUNIT_INCLUDE_DIR)
50 SET(CPPUNIT_FOUND "YES")
51 SET(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARY} ${CMAKE_DL_LIBS})
52 SET(CPPUNIT_DEBUG_LIBRARIES ${CPPUNIT_DEBUG_LIBRARY} ${CMAKE_DL_LIBS})
53 ENDIF(CPPUNIT_LIBRARY)
54 ENDIF(CPPUNIT_INCLUDE_DIR)
56 ELSE(URANIE AND WIN32)
57 FIND_PACKAGE(SalomeCppUnit)
58 SALOME_LOG_OPTIONAL_PACKAGE(CppUnit SALOME_BUILD_TESTS)
59 ENDIF(URANIE AND WIN32)
61 ADD_DEFINITIONS(${CPPUNIT_DEFINITIONS})
65 ${CPPUNIT_INCLUDE_DIR}
66 ${CMAKE_CURRENT_SOURCE_DIR}/
67 ${CMAKE_CURRENT_SOURCE_DIR}/..
69 ELSE(URANIE AND WIN32)
71 ${CPPUNIT_INCLUDE_DIRS}
72 ${CMAKE_CURRENT_SOURCE_DIR}/
73 ${CMAKE_CURRENT_SOURCE_DIR}/..
75 ENDIF(URANIE AND WIN32)
83 ADD_EXECUTABLE(TestPMML ${TestPMML_SOURCES})
86 IF(SALOME_CMAKE_DEBUG)
87 TARGET_LINK_LIBRARIES(TestPMML pmmlLib ${CPPUNIT_DEBUG_LIBRARY} ${PLATFORM_LIBS})
88 ELSE(SALOME_CMAKE_DEBUG)
89 TARGET_LINK_LIBRARIES(TestPMML pmmlLib ${CPPUNIT_LIBRARY} ${PLATFORM_LIBS})
90 ENDIF(SALOME_CMAKE_DEBUG)
91 ELSE(URANIE AND WIN32)
92 TARGET_LINK_LIBRARIES(TestPMML pmmlLib
93 ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS})
94 ENDIF(URANIE AND WIN32)
96 ADD_TEST(TestPMML TestPMML)
98 FILE(COPY ${PROJECT_SOURCE_DIR}/src/pmml/Test/samples DESTINATION . )
99 INSTALL(TARGETS TestPMML DESTINATION ${SALOME_INSTALL_BINS})
103 SET(LOCAL_TEST_DIR ${SALOME_YACS_INSTALL_TEST}/pmml/Test)
104 INSTALL(TARGETS TestPMML DESTINATION ${LOCAL_TEST_DIR})
105 INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${LOCAL_TEST_DIR} RENAME CTestTestfile.cmake)
106 FILE(GLOB sample_files ${PROJECT_SOURCE_DIR}/src/pmml/Test/samples/*)
107 INSTALL(FILES ${sample_files} DESTINATION ${LOCAL_TEST_DIR}/samples)