]> SALOME platform Git repositories - modules/kernel.git/blob - src/Launcher/CMakeLists.txt
Salome HOME
merge from BR_KERNEL_REFACTORING
[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   ${LIBXML_INCLUDE_DIRS}
22   ${OMNIORB_INCLUDE_DIRS}
23   ${PYTHON_INCLUDE_DIRS}
24   ${PTHREAD_INCLUDE_DIRS}
25   ${MPI_INCLUDE_DIRS}
26   ${LIBBATCH_INCLUDE_DIRS}
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 SET(WITH_LIBBATCH_FLAG)
39 IF(WITH_LIBBATCH)
40   SET(WITH_LIBBATCH_FLAG "-DWITH_LIBBATCH")
41 ENDIF(WITH_LIBBATCH)
42
43 # This local variable defines the list of FLAGS common to all target in this package.
44 SET(COMMON_FLAGS "${MPI_DEFINITIONS} ${LIBXML_DEFINITIONS} ${OMNIORB_DEFINITIONS} ${WITH_LIBBATCH_FLAG} ${PLATFORM_DEFINITIONS}")
45
46 # This local variable defines the list of dependant libraries common to all target in this package.
47 SET(COMMON_LIBS
48   Registry
49   SalomeNotification
50   SalomeContainer
51   SalomeResourcesManager
52   SalomeNS
53   OpUtil
54   SALOMELocalTrace
55   SALOMEBasics
56   SalomeIDLKernel
57   ${LIBBATCH_LIBS}
58   ${MPI_LIBS}
59   ${OMNIORB_LIBS}
60   ${LIBXML_LIBS}
61   ${PYTHON_LIBS}
62 )
63
64 SET(Launcher_SOURCES
65   SALOME_Launcher_Parser.cxx
66   SALOME_Launcher_Handler.cxx
67   Launcher_Utils.hxx
68   Launcher_Job.cxx
69   Launcher_Job_Command.cxx
70   Launcher_Job_SALOME.cxx
71   Launcher_Job_PythonSALOME.cxx
72   Launcher_Job_YACSFile.cxx
73   Launcher.cxx
74 )
75 SET(Launcher_FLAGS "${MPI_DEFINITIONS} ${LIBXML_DEFINITIONS} ${LIBBATCH_DEFINITIONS} ${WITH_LIBBATCH_FLAG} ${PLATFORM_DEFINITIONS}")
76
77 ADD_LIBRARY(Launcher SHARED ${Launcher_SOURCES})
78 SET_TARGET_PROPERTIES(Launcher PROPERTIES COMPILE_FLAGS "${Launcher_FLAGS}")
79 TARGET_LINK_LIBRARIES(Launcher ResourcesManager ${LIBBATCH_LIBS} ${MPI_LIBS} ${LIBXML_LIBS})
80 INSTALL(TARGETS Launcher DESTINATION ${KERNEL_salomelib_LIBS})
81
82 SET(TestLauncher_LIBS
83   ${LIBXML_LIBS}
84   ResourcesManager
85   Launcher
86   OpUtil
87   ${LIBBATCH_LIBS}
88 )
89
90 ADD_EXECUTABLE(TestLauncher TestLauncher.cxx)
91 SET_TARGET_PROPERTIES(TestLauncher PROPERTIES COMPILE_FLAGS "${LIBXML_DEFINITIONS} ${LIBBATCH_DEFINITIONS} ${WITH_LIBBATCH_FLAG} ${PLATFORM_DEFINITIONS}")
92 TARGET_LINK_LIBRARIES(TestLauncher ${TestLauncher_LIBS})
93 INSTALL(TARGETS TestLauncher DESTINATION ${KERNEL_salomebin_BINS})
94
95 IF(NOT WITHONLYLAUNCHER)
96   ADD_LIBRARY(SalomeLauncher SHARED BatchTest.cxx SALOME_Launcher.cxx)
97   SET_TARGET_PROPERTIES(SalomeLauncher PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
98   TARGET_LINK_LIBRARIES(SalomeLauncher Launcher ${COMMON_LIBS})
99   INSTALL(TARGETS SalomeLauncher DESTINATION ${KERNEL_salomelib_LIBS})
100   
101   SET(SALOME_LauncherServer_LIBS
102     Launcher
103     SalomeLauncher
104     SALOMEBasics
105     SALOMELocalTrace
106     ${LIBBATCH_LIBS}
107     ${MPI_LIBS}
108     ${OMNIORB_LIBS}
109     ${LIBXML_LIBS}
110     ${PYTHON_LIBS}
111   )
112
113   
114
115   ADD_EXECUTABLE(SALOME_LauncherServer SALOME_LauncherServer.cxx)
116   SET_TARGET_PROPERTIES(SALOME_LauncherServer PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
117   TARGET_LINK_LIBRARIES(SALOME_LauncherServer ${SALOME_LauncherServer_LIBS})
118   INSTALL(TARGETS SALOME_LauncherServer DESTINATION ${KERNEL_salomebin_BINS})
119 ENDIF(NOT WITHONLYLAUNCHER)
120
121 FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
122 INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${KERNEL_salomeinclude_HEADERS})