Salome HOME
CMake:
[modules/yacs.git] / src / yacsloader / 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   ${EXPAT_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}/../../runtime
36   ${CMAKE_CURRENT_SOURCE_DIR}
37   ${CMAKE_CURRENT_BINARY_DIR}
38 )
39
40 # --- sources ---
41
42 # idl files
43 SET(echo_IDL_FILES
44   echo.idl
45 )
46 SET(echo_IDL_SOURCES
47   echoSK.cc
48 )
49 SET(IDL_INCLUDE_DIRS
50   ${KERNEL_ROOT_DIR}/idl/salome
51   ${CMAKE_CURRENT_SOURCE_DIR}
52   ${CMAKE_CURRENT_BINARY_DIR}
53 )
54 SET(IDL_LINK_FLAGS
55   ${KERNEL_SalomeIDLKernel}
56 )
57
58 # tests variables
59
60 SET(echoSrv_SOURCES
61   echoSrv.cxx 
62 )
63 SET(echoSrv_LIBRARIES
64   ${OMNIORB_LIBRARIES}
65   ${PTHREAD_LIBRARIES}
66 )
67   
68 SET(TestYacsLoader_SOURCES
69   TestYacsLoader.cxx
70   YacsLoaderTest.cxx
71 )
72 SET(TestYacsLoader_LIBRARIES
73   ${CPPUNIT_LIBRARIES}
74   ${OMNIORB_LIBRARIES}
75   ${PYTHON_LIBRARIES}
76   YACSloader
77   YACSRuntimeSALOME
78   YACSlibEngine
79   YACSBases
80 )
81
82 SET(TestOptLoop_SOURCES
83   OptimizerAlgSyncExample.cxx 
84   OptimizerAlgASyncExample.cxx
85 )
86
87 # --- rules ---
88
89 OMNIORB_ADD_MODULE(yacsloader_echo "${echo_IDL_FILES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_FLAGS}")
90
91 ADD_EXECUTABLE(TestYacsLoader ${TestYacsLoader_SOURCES})
92 TARGET_LINK_LIBRARIES(TestYacsLoader ${TestYacsLoader_LIBRARIES})
93
94 ADD_EXECUTABLE(echoSrv ${echoSrv_SOURCES})
95 TARGET_LINK_LIBRARIES(echoSrv yacsloader_echo ${echoSrv_LIBRARIES})
96 INSTALL(TARGETS echoSrv DESTINATION ${SALOME_INSTALL_BINS})
97
98 ADD_LIBRARY(TestOptLoop ${TestOptLoop_SOURCES})
99 TARGET_LINK_LIBRARIES(TestOptLoop YACSlibEngine)
100
101 IF(NOT WIN32)
102   SET(SHELL /bin/sh)
103   SALOME_CONFIGURE_FILE(config_appli.xml.in config_appli.xml)
104   SALOME_CONFIGURE_FILE(YacsLoaderTest.sh.in YacsLoaderTest.sh)
105   SALOME_CONFIGURE_FILE(YacsLoaderInSessionTest.sh.in YacsLoaderInSessionTest.sh)
106   SALOME_CONFIGURE_FILE(display.sh.in VERSION INSTALL ${SALOME_INSTALL_BINS})
107   SALOME_CONFIGURE_FILE(waitContainers.py waitContainers.py)
108   ADD_TEST(NAME YacsLoaderTest COMMAND ${SHELL} YacsLoaderTest.sh)
109 ENDIF()