]> SALOME platform Git repositories - modules/kernel.git/blob - src/Launcher/CMakeLists.txt
Salome HOME
Merge from V6_main 28/02/2013
[modules/kernel.git] / src / Launcher / CMakeLists.txt
1 # Copyright (C) 2012  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_DIRECTORIES(
21   ${LIBXML2_INCLUDE_DIR}
22   ${OMNIORB_INCLUDE_DIR}
23   ${PYTHON_INCLUDE_DIRS}
24   ${PTHREAD_INCLUDE_DIRS}
25   ${MPI_CXX_INCLUDE_PATH}
26   ${LIBBATCH_INCLUDE_DIR}
27   ${CMAKE_BINARY_DIR}/salome_adm
28   ${CMAKE_CURRENT_SOURCE_DIR}/../Basics
29   ${CMAKE_CURRENT_SOURCE_DIR}/../SALOMELocalTrace
30   ${CMAKE_CURRENT_SOURCE_DIR}/../NamingService
31   ${CMAKE_CURRENT_SOURCE_DIR}/../Utils
32   ${CMAKE_CURRENT_SOURCE_DIR}/../Registry
33   ${CMAKE_CURRENT_SOURCE_DIR}/../Notification
34   ${CMAKE_CURRENT_SOURCE_DIR}/../Container
35   ${CMAKE_CURRENT_SOURCE_DIR}/../ResourcesManager
36   ${CMAKE_BINARY_DIR}/idl
37 )
38
39 ADD_DEFINITIONS(${MPI_CXX_COMPILE_FLAGS} ${LIBXML2_DEFINITIONS} ${OMNIORB_DEFINITIONS})
40 IF(SALOME_USE_LIBBATCH AND LIBBATCH_FOUND)
41   ADD_DEFINITIONS(-DWITH_LIBBATCH)
42 ENDIF(SALOME_USE_LIBBATCH AND LIBBATCH_FOUND)
43
44 # This local variable defines the list of dependant libraries common to all target in this package.
45 SET(COMMON_LIBS
46   Registry
47   SalomeNotification
48   SalomeContainer
49   SalomeResourcesManager
50   SalomeNS
51   OpUtil
52   SALOMELocalTrace
53   SALOMEBasics
54   SalomeIDLKernel
55   ${LIBBATCH_LIBRARIES}
56   ${MPI_CXX_LIBRARIES}
57   ${OMNIORB_LIBRARIES}
58   ${LIBXML2_LIBRARIES}
59   ${PYTHON_LIBRARIES}
60 )
61
62 SET(Launcher_SOURCES
63   SALOME_Launcher_Parser.cxx
64   SALOME_Launcher_Handler.cxx
65   Launcher_Job.cxx
66   Launcher_Job_Command.cxx
67   Launcher_Job_SALOME.cxx
68   Launcher_Job_PythonSALOME.cxx
69   Launcher_Job_YACSFile.cxx
70   Launcher.cxx
71 )
72
73 ADD_LIBRARY(Launcher ${Launcher_SOURCES})
74 TARGET_LINK_LIBRARIES(Launcher ResourcesManager ${LIBBATCH_LIBRARIES} ${MPI_CXX_LIBRARIES} ${LIBXML2_LIBS})
75 INSTALL(TARGETS Launcher DESTINATION ${KERNEL_salomelib_LIBS})
76
77 SET(TestLauncher_LIBS
78   ${LIBXML2_LIBRARIES}
79   ResourcesManager
80   Launcher
81   OpUtil
82   ${LIBBATCH_LIBRARIES}
83 )
84
85 ADD_EXECUTABLE(TestLauncher TestLauncher.cxx)
86 TARGET_LINK_LIBRARIES(TestLauncher ${TestLauncher_LIBS})
87 INSTALL(TARGETS TestLauncher DESTINATION ${KERNEL_salomebin_BINS})
88
89 IF(NOT WITHONLYLAUNCHER)
90   ADD_LIBRARY(SalomeLauncher BatchTest.cxx SALOME_Launcher.cxx)
91   TARGET_LINK_LIBRARIES(SalomeLauncher Launcher ${COMMON_LIBS})
92   INSTALL(TARGETS SalomeLauncher DESTINATION ${KERNEL_salomelib_LIBS})
93   
94   SET(SALOME_LauncherServer_LIBS
95     Launcher
96     SalomeLauncher
97     SALOMEBasics
98     SALOMELocalTrace
99     ${LIBBATCH_LIBRARIES}
100     ${MPI_CXX_LIBRARIES}
101     ${OMNIORB_LIBRARIES}
102     ${LIBXML2_LIBRARIES}
103     ${PYTHON_LIBRARIES}
104   )
105
106   
107
108   ADD_EXECUTABLE(SALOME_LauncherServer SALOME_LauncherServer.cxx)
109   TARGET_LINK_LIBRARIES(SALOME_LauncherServer ${SALOME_LauncherServer_LIBS})
110   INSTALL(TARGETS SALOME_LauncherServer DESTINATION ${KERNEL_salomebin_BINS})
111 ENDIF(NOT WITHONLYLAUNCHER)
112
113 FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
114 INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${KERNEL_salomeinclude_HEADERS})