]> SALOME platform Git repositories - modules/yacs.git/blob - src/runtime/Test/CMakeLists.txt
Salome HOME
Before virtualization of SalomeContainerTools
[modules/yacs.git] / src / runtime / Test / CMakeLists.txt
1 # Copyright (C) 2012-2019  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 INCLUDE(UseOmniORB)
21
22 # --- options ---
23
24 # additional include directories
25 INCLUDE_DIRECTORIES(
26   ${CPPUNIT_INCLUDE_DIRS}
27   ${PYTHON_INCLUDE_DIR}
28   ${OMNIORB_INCLUDE_DIR}
29   ${OMNIORBPY_INCLUDE_DIR}
30   ${KERNEL_INCLUDE_DIRS}
31   ${CMAKE_CURRENT_SOURCE_DIR}/..
32   ${CMAKE_CURRENT_SOURCE_DIR}/../../bases
33   ${CMAKE_CURRENT_SOURCE_DIR}/../../bases/Test
34   ${CMAKE_CURRENT_SOURCE_DIR}/../../engine
35   ${CMAKE_CURRENT_SOURCE_DIR}/../../engine/Test
36   ${CMAKE_CURRENT_SOURCE_DIR}
37   ${CMAKE_CURRENT_BINARY_DIR}
38 )
39
40 # additional preprocessor / compiler flags
41 ADD_DEFINITIONS(
42   ${PTHREAD_DEFINITIONS}
43   ${OMNIORB_DEFINITIONS}
44   -DUSE_CPPUNIT
45 )
46
47 # --- sources ---
48
49 # idl files
50 SET(echo_IDL_FILES
51   echo.idl
52 )
53 SET(echo_IDL_SOURCES
54   echoSK.cc 
55   echoDynSK.cc 
56 )
57 SET(IDL_INCLUDE_DIRS
58   ${KERNEL_ROOT_DIR}/idl/salome
59   ${CMAKE_CURRENT_SOURCE_DIR}
60   ${CMAKE_CURRENT_BINARY_DIR}
61 )
62 SET(IDL_LINK_FLAGS
63   ${KERNEL_SalomeIDLKernel}
64 )
65
66 # tests variables
67
68 SET(TestRuntime_SOURCES
69   TestRuntime.cxx
70   runtimeTest.cxx
71 )
72 SET(TestRuntime_LIBRARIES
73   ${CPPUNIT_LIBRARIES}
74   ${OMNIORB_LIBRARIES}
75   ${PYTHON_LIBRARIES}
76   YACSRuntimeSALOME
77   YACSlibEngine
78   YACSBases
79 )
80   
81 SET(runtimeTestEchoSrv_SOURCES
82   echoSrv.cxx
83 )
84
85 SET(echo_clt_SOURCES
86   echo_clt.cxx
87 )
88
89 SET(TestComponentLocal_SOURCES
90   TestComponent.cxx
91 )
92
93 # --- rules ---
94
95 OMNIORB_ADD_MODULE(runtime_echo "${echo_IDL_FILES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_FLAGS}")
96
97 ADD_EXECUTABLE(TestRuntime ${TestRuntime_SOURCES})
98 TARGET_LINK_LIBRARIES(TestRuntime ${TestRuntime_LIBRARIES})
99
100 ADD_EXECUTABLE(runtimeTestEchoSrv ${runtimeTestEchoSrv_SOURCES})
101 TARGET_LINK_LIBRARIES(runtimeTestEchoSrv runtime_echo ${OMNIORB_LIBRARIES})
102
103 ADD_EXECUTABLE(echo_clt ${echo_clt_SOURCES})
104 TARGET_LINK_LIBRARIES(echo_clt runtime_echo ${OMNIORB_LIBRARIES})
105
106 ADD_LIBRARY(TestComponentLocal ${TestComponentLocal_SOURCES})
107 TARGET_LINK_LIBRARIES(TestComponentLocal YACSlibEngine)
108
109 # For salome test
110 SET(LOCAL_TEST_DIR ${SALOME_YACS_INSTALL_TEST}/runtime)
111 INSTALL(TARGETS TestComponentLocal EXPORT ${PROJECT_NAME}TargetGroup
112         DESTINATION ${LOCAL_TEST_DIR}/lib/salome)
113
114 SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
115
116 IF(NOT WIN32)
117   SET(SHELL /bin/sh)
118   SALOME_CONFIGURE_FILE(xmlrun_orig.sh xmlrun.sh)
119   ADD_TEST(NAME runtimeTest COMMAND ${SHELL} ${CMAKE_CURRENT_SOURCE_DIR}/runtimeTest.sh)
120   SET_TESTS_PROPERTIES(runtimeTest PROPERTIES ENVIRONMENT "${tests_env}")
121   INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/xmlrun.sh DESTINATION ${LOCAL_TEST_DIR})
122 ENDIF() 
123
124 INSTALL(PROGRAMS runtimeTest.sh DESTINATION ${LOCAL_TEST_DIR})
125 INSTALL(TARGETS runtime_echo DESTINATION ${SALOME_YACS_INSTALL_TEST_LIB})
126 INSTALL(TARGETS TestRuntime DESTINATION ${LOCAL_TEST_DIR})
127 INSTALL(TARGETS runtimeTestEchoSrv DESTINATION ${LOCAL_TEST_DIR})
128 INSTALL(TARGETS echo_clt DESTINATION ${LOCAL_TEST_DIR})
129 INSTALL(FILES CTestTestfileInstall.cmake
130         DESTINATION ${LOCAL_TEST_DIR}
131         RENAME CTestTestfile.cmake)