]> SALOME platform Git repositories - modules/kernel.git/blob - src/Launcher/CMakeLists.txt
Salome HOME
Merge branch 'omu/Launcher9'
[modules/kernel.git] / src / Launcher / CMakeLists.txt
1 # Copyright (C) 2012-2016  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, 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 IF(SALOME_BUILD_TESTS)
21   ADD_SUBDIRECTORY(Test)
22 ENDIF(SALOME_BUILD_TESTS)
23
24 INCLUDE_DIRECTORIES(
25   ${LIBXML2_INCLUDE_DIR}
26   ${OMNIORB_INCLUDE_DIR}
27   ${PYTHON_INCLUDE_DIRS}
28   ${PTHREAD_INCLUDE_DIR}
29   ${Boost_INCLUDE_DIR}
30   ${LIBBATCH_INCLUDE_DIRS}
31   ${PROJECT_BINARY_DIR}/salome_adm
32   ${CMAKE_CURRENT_SOURCE_DIR}/../Basics
33   ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace
34   ${CMAKE_CURRENT_SOURCE_DIR}/../NamingService
35   ${CMAKE_CURRENT_SOURCE_DIR}/../Utils
36   ${CMAKE_CURRENT_SOURCE_DIR}/../Registry
37   ${CMAKE_CURRENT_SOURCE_DIR}/../Notification
38   ${CMAKE_CURRENT_SOURCE_DIR}/../Container
39   ${CMAKE_CURRENT_SOURCE_DIR}/../ResourcesManager
40   ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMESDS
41   ${PROJECT_BINARY_DIR}/idl
42 )
43
44 ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${BOOST_DEFINITIONS} ${OMNIORB_DEFINITIONS})
45 IF(SALOME_USE_LIBBATCH)
46   ADD_DEFINITIONS(-DWITH_LIBBATCH)
47 ENDIF(SALOME_USE_LIBBATCH)
48
49 # This local variable defines the list of dependent libraries common to all target in this package.
50 SET(COMMON_LIBS
51   Registry
52   SalomeNotification
53   SalomeContainer
54   SalomeResourcesManager
55   SalomeNS
56   OpUtil
57   SALOMELocalTrace
58   SALOMEBasics
59   SalomeIDLKernel
60   ${Boost_FILESYSTEM_LIBRARY}
61   ${Boost_SYSTEM_LIBRARY}
62   ${LIBBATCH_LIBRARIES}
63   ${OMNIORB_LIBRARIES}
64   ${LIBXML2_LIBRARIES}
65   ${PYTHON_LIBRARIES}
66 )
67
68 SET(Launcher_SOURCES
69   SALOME_Launcher_Parser.cxx
70   SALOME_Launcher_Handler.cxx
71   Launcher_Job.cxx
72   Launcher_Job_Command.cxx
73   Launcher_Job_CommandSALOME.cxx
74   Launcher_Job_SALOME.cxx
75   Launcher_Job_PythonSALOME.cxx
76   Launcher_Job_YACSFile.cxx
77   Launcher.cxx
78   Launcher_XML_Persistence.cxx
79 )
80
81 ADD_LIBRARY(Launcher ${Launcher_SOURCES})
82 TARGET_LINK_LIBRARIES(Launcher ResourcesManager ${LIBBATCH_LIBRARIES} ${LIBXML2_LIBS} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY})
83 INSTALL(TARGETS Launcher EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
84
85 SET(TestLauncher_LIBS
86   ${LIBXML2_LIBRARIES}
87   ResourcesManager
88   Launcher
89   ${LIBBATCH_LIBRARIES}
90   ${Boost_FILESYSTEM_LIBRARY}
91   ${Boost_SYSTEM_LIBRARY}
92 )
93
94 # TestLauncher needs only (and must need only) libxml, libbatch, ResourceManager and Launcher libraries!
95 ADD_EXECUTABLE(TestLauncher TestLauncher.cxx)
96 TARGET_LINK_LIBRARIES(TestLauncher ${TestLauncher_LIBS})
97 INSTALL(TARGETS TestLauncher DESTINATION ${SALOME_INSTALL_BINS})
98
99 ADD_LIBRARY(SalomeLauncher BatchTest.cxx SALOME_Launcher.cxx)
100 TARGET_LINK_LIBRARIES(SalomeLauncher Launcher ${COMMON_LIBS})
101 INSTALL(TARGETS SalomeLauncher EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
102   
103 SET(SALOME_LauncherServer_LIBS
104   Launcher
105   SalomeLauncher
106   SalomeSDS
107   SALOMEBasics
108   SALOMELocalTrace
109   ${LIBBATCH_LIBRARIES}
110   ${OMNIORB_LIBRARIES}
111   ${LIBXML2_LIBRARIES}
112   ${PYTHON_LIBRARIES}
113 )
114
115 ADD_EXECUTABLE(SALOME_LauncherServer SALOME_LauncherServer.cxx)
116 TARGET_LINK_LIBRARIES(SALOME_LauncherServer ${SALOME_LauncherServer_LIBS})
117 INSTALL(TARGETS SALOME_LauncherServer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS})
118
119 SET(COMMON_HEADERS_HXX
120   BatchTest.hxx
121   Launcher.hxx
122   Launcher_Job.hxx
123   Launcher_Job_Command.hxx
124   Launcher_Job_CommandSALOME.hxx
125   Launcher_Job_PythonSALOME.hxx
126   Launcher_Job_SALOME.hxx
127   Launcher_Job_YACSFile.hxx
128   Launcher_Utils.hxx
129   SALOME_Launcher.hxx
130   SALOME_Launcher_Parser.hxx
131   SALOME_Launcher_defs.hxx
132 )
133
134 SET(LAUNCHER_PYTHON_SCRIPTS
135   launcher_proxy.py
136 )
137
138 INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS})
139 INSTALL(FILES testLauncher.xml DESTINATION ${SALOME_KERNEL_INSTALL_RES_DATA})
140 SALOME_INSTALL_SCRIPTS("${LAUNCHER_PYTHON_SCRIPTS}" ${SALOME_INSTALL_PYTHON})