Salome HOME
f39fc7732c95e064330325d65e76d97dcd3b6a25
[modules/yacs.git] / src / runtime / Test / CMakeLists.txt
1 # Copyright (C) 2012-2013  CEA/DEN, EDF R&D, OPEN CASCADE
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.
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   ${KERNEL_INCLUDE_DIRS}
30   ${CMAKE_CURRENT_SOURCE_DIR}/..
31   ${CMAKE_CURRENT_SOURCE_DIR}/../../bases
32   ${CMAKE_CURRENT_SOURCE_DIR}/../../bases/Test
33   ${CMAKE_CURRENT_SOURCE_DIR}/../../engine
34   ${CMAKE_CURRENT_SOURCE_DIR}/../../engine/Test
35   ${CMAKE_CURRENT_SOURCE_DIR}
36   ${CMAKE_CURRENT_BINARY_DIR}
37 )
38
39 # additional preprocessor / compiler flags
40 ADD_DEFINITIONS(
41   ${PTHREAD_DEFINITIONS}
42   -DUSE_CPPUNIT
43 )
44
45 # --- sources ---
46
47 # idl files
48 SET(echo_IDL_FILES
49   echo.idl
50 )
51 SET(echo_IDL_SOURCES
52   echoSK.cc 
53   echoDynSK.cc 
54 )
55 SET(IDL_INCLUDE_DIRS
56   ${KERNEL_ROOT_DIR}/idl/salome
57   ${CMAKE_CURRENT_SOURCE_DIR}
58   ${CMAKE_CURRENT_BINARY_DIR}
59 )
60 SET(IDL_LINK_FLAGS
61   ${KERNEL_SalomeIDLKernel}
62 )
63
64 # tests variables
65
66 SET(TestRuntime_SOURCES
67   TestRuntime.cxx
68   runtimeTest.cxx
69 )
70 SET(TestRuntime_LIBRARIES
71   ${CPPUNIT_LIBRARIES}
72   ${OMNIORB_LIBRARIES}
73   ${PYTHON_LIBRARIES}
74   YACSRuntimeSALOME
75   YACSlibEngine
76   YACSBases
77 )
78   
79 SET(runtimeTestEchoSrv_SOURCES
80   echoSrv.cxx
81 )
82
83 SET(echo_clt_SOURCES
84   echo_clt.cxx
85 )
86
87 SET(TestComponentLocal_SOURCES
88   TestComponent.cxx
89 )
90
91 # --- rules ---
92
93 OMNIORB_ADD_MODULE(runtime_echo "${echo_IDL_FILES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_FLAGS}")
94
95 ADD_EXECUTABLE(TestRuntime ${TestRuntime_SOURCES})
96 TARGET_LINK_LIBRARIES(TestRuntime ${TestRuntime_LIBRARIES})
97
98 ADD_EXECUTABLE(runtimeTestEchoSrv ${runtimeTestEchoSrv_SOURCES})
99 TARGET_LINK_LIBRARIES(runtimeTestEchoSrv runtime_echo ${OMNIORB_LIBRARIES})
100
101 ADD_EXECUTABLE(echo_clt ${echo_clt_SOURCES})
102 TARGET_LINK_LIBRARIES(echo_clt runtime_echo ${OMNIORB_LIBRARIES})
103
104 ADD_LIBRARY(TestComponentLocal ${TestComponentLocal_SOURCES})
105 TARGET_LINK_LIBRARIES(TestComponentLocal YACSlibEngine)
106 INSTALL(TARGETS TestComponentLocal EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
107
108 SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
109
110 IF(NOT WIN32)
111   SET(SHELL /bin/sh)
112   SALOME_CONFIGURE_FILE(xmlrun_orig.sh xmlrun.sh)
113   ADD_TEST(NAME runtimeTest COMMAND ${SHELL} ${CMAKE_CURRENT_SOURCE_DIR}/runtimeTest.sh)
114   SET_TESTS_PROPERTIES(runtimeTest PROPERTIES ENVIRONMENT ${tests_env}) 
115 ENDIF()