Salome HOME
Debug of CMake build procedure
[modules/yacs.git] / src / yacsloader / Test / CMakeLists.txt
1 # Copyright (C) 2012-2014  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   ${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 # additional preprocessor / compiler flags
41 ADD_DEFINITIONS(
42   ${OMNIORB_DEFINITIONS}
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 )
54 SET(IDL_INCLUDE_DIRS
55   ${KERNEL_ROOT_DIR}/idl/salome
56   ${CMAKE_CURRENT_SOURCE_DIR}
57   ${CMAKE_CURRENT_BINARY_DIR}
58 )
59 SET(IDL_LINK_FLAGS
60   ${KERNEL_SalomeIDLKernel}
61 )
62
63 # tests variables
64
65 SET(echoSrv_SOURCES
66   echoSrv.cxx 
67 )
68 SET(echoSrv_LIBRARIES
69   ${OMNIORB_LIBRARIES}
70   ${PTHREAD_LIBRARIES}
71 )
72   
73 SET(TestYacsLoader_SOURCES
74   TestYacsLoader.cxx
75   YacsLoaderTest.cxx
76 )
77 SET(TestYacsLoader_LIBRARIES
78   ${CPPUNIT_LIBRARIES}
79   ${OMNIORB_LIBRARIES}
80   ${PYTHON_LIBRARIES}
81   YACSloader
82   YACSRuntimeSALOME
83   YACSlibEngine
84   YACSBases
85 )
86
87 SET(TestOptLoop_SOURCES
88   OptimizerAlgSyncExample.cxx 
89   OptimizerAlgASyncExample.cxx
90 )
91
92 # --- rules ---
93
94 OMNIORB_ADD_MODULE(yacsloader_echo "${echo_IDL_FILES}" "${IDL_INCLUDE_DIRS}" "${IDL_LINK_FLAGS}")
95 INSTALL(TARGETS yacsloader_echo DESTINATION ${SALOME_INSTALL_LIBS})
96
97 ADD_EXECUTABLE(TestYacsLoader ${TestYacsLoader_SOURCES})
98 TARGET_LINK_LIBRARIES(TestYacsLoader yacsloader_echo ${TestYacsLoader_LIBRARIES})
99
100 ADD_EXECUTABLE(echoSrv ${echoSrv_SOURCES})
101 TARGET_LINK_LIBRARIES(echoSrv yacsloader_echo ${echoSrv_LIBRARIES})
102 INSTALL(TARGETS echoSrv DESTINATION ${SALOME_INSTALL_BINS})
103
104 ADD_LIBRARY(TestOptLoop ${TestOptLoop_SOURCES})
105 TARGET_LINK_LIBRARIES(TestOptLoop yacsloader_echo YACSlibEngine)
106
107 IF(NOT WIN32)
108   SET(SHELL /bin/sh)
109   SALOME_CONFIGURE_FILE(config_appli.xml.in config_appli.xml)
110   SALOME_CONFIGURE_FILE(YacsLoaderTest.sh.in YacsLoaderTest.sh)
111   SALOME_CONFIGURE_FILE(YacsLoaderInSessionTest.sh.in YacsLoaderInSessionTest.sh)
112   SALOME_CONFIGURE_FILE(display.sh.in display.sh)
113   SALOME_CONFIGURE_FILE(waitContainers.py waitContainers.py)
114   SALOME_CONFIGURE_FILE(xmlrun_orig.sh xmlrun.sh)
115   ADD_TEST(NAME YacsLoaderTest COMMAND ${SHELL} YacsLoaderTest.sh)
116 ENDIF()