1 # Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
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.
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.
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
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
20 PROJECT(SalomeJOBMANAGER C CXX)
22 # Ensure a proper linker behavior:
23 CMAKE_POLICY(SET CMP0003 NEW)
27 # Project name, upper case
28 STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
30 SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7)
31 SET(${PROJECT_NAME_UC}_MINOR_VERSION 2)
32 SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
33 SET(${PROJECT_NAME_UC}_VERSION
34 ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
35 SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
39 SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL")
40 IF(EXISTS ${KERNEL_ROOT_DIR})
41 LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
43 FIND_PACKAGE(SalomeKERNEL REQUIRED)
44 ELSE(EXISTS ${KERNEL_ROOT_DIR})
45 MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR")
46 ENDIF(EXISTS ${KERNEL_ROOT_DIR})
49 MESSAGE(FATAL_ERROR "JOBMANAGER module can't be built in Light mode (without CORBA)")
54 INCLUDE(SalomeSetupPlatform) # From KERNEL
55 # Always build libraries as shared objects:
56 SET(BUILD_SHARED_LIBS TRUE)
58 LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local/cmake_files")
61 # (some options have already been defined in KERNEL)
63 #OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ${SALOME_BUILD_TESTS}) For use in the future
64 OPTION(SALOME_BUILD_DOC "Generate SALOME JOBMANAGER documentation" ON)
72 FIND_PACKAGE(SalomeBoost REQUIRED)
74 FIND_PACKAGE(SalomeOmniORB REQUIRED)
76 # Other KERNEL optionals:
78 FIND_PACKAGE(SalomeMPI) # needed for doc generation by Sphinx
81 FIND_PACKAGE(SalomeSphinx)
82 SALOME_LOG_OPTIONAL_PACKAGE(Sphinx SALOME_BUILD_DOC)
87 SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR} CACHE PATH "Path to the Salome GUI")
88 IF(EXISTS ${GUI_ROOT_DIR})
89 LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files")
90 FIND_PACKAGE(SalomeGUI)
91 ELSE(EXISTS ${GUI_ROOT_DIR})
92 MESSAGE(FATAL_ERROR "We absolutely need a Salome GUI, please define GUI_ROOT_DIR")
93 ENDIF(EXISTS ${GUI_ROOT_DIR})
96 FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml)
97 INCLUDE(${QT_USE_FILE})
100 SALOME_PACKAGE_REPORT_AND_CHECK()
103 # (default values taken from KERNEL)
105 SET(SALOME_INSTALL_BINS "${SALOME_INSTALL_BINS}" CACHE PATH "Install path: SALOME binaries")
106 SET(SALOME_INSTALL_LIBS "${SALOME_INSTALL_LIBS}" CACHE PATH "Install path: SALOME libs")
107 SET(SALOME_INSTALL_IDLS "${SALOME_INSTALL_IDLS}" CACHE PATH "Install path: SALOME IDL files")
108 SET(SALOME_INSTALL_HEADERS "${SALOME_INSTALL_HEADERS}" CACHE PATH "Install path: SALOME headers")
109 SET(SALOME_INSTALL_SCRIPT_SCRIPTS "${SALOME_INSTALL_SCRIPT_SCRIPTS}" CACHE PATH
110 "Install path: SALOME scripts")
111 SET(SALOME_INSTALL_SCRIPT_DATA "${SALOME_INSTALL_SCRIPT_DATA}" CACHE PATH
112 "Install path: SALOME script data")
113 SET(SALOME_INSTALL_SCRIPT_PYTHON "${SALOME_INSTALL_SCRIPT_PYTHON}" CACHE PATH
114 "Install path: SALOME Python scripts")
115 SET(SALOME_INSTALL_APPLISKEL_SCRIPTS "${SALOME_INSTALL_APPLISKEL_SCRIPTS}" CACHE PATH
116 "Install path: SALOME application skeleton - scripts")
117 SET(SALOME_INSTALL_APPLISKEL_PYTHON "${SALOME_INSTALL_APPLISKEL_PYTHON}" CACHE PATH
118 "Install path: SALOME application skeleton - Python")
119 SET(SALOME_INSTALL_PYTHON "${SALOME_INSTALL_PYTHON}" CACHE PATH "Install path: SALOME Python stuff")
120 SET(SALOME_INSTALL_PYTHON_SHARED "${SALOME_INSTALL_PYTHON_SHARED}" CACHE PATH
121 "Install path: SALOME Python shared modules")
122 SET(SALOME_INSTALL_CMAKE_LOCAL "${SALOME_INSTALL_CMAKE_LOCAL}" CACHE PATH
123 "Install path: local SALOME CMake files")
124 SET(SALOME_INSTALL_AMCONFIG_LOCAL "${SALOME_INSTALL_AMCONFIG_LOCAL}" CACHE PATH
125 "Install path: local SALOME config files (obsolete, to be removed)")
126 SET(SALOME_INSTALL_RES "${SALOME_INSTALL_RES}" CACHE PATH "Install path: SALOME resources")
127 SET(SALOME_INSTALL_DOC "${SALOME_INSTALL_DOC}" CACHE PATH "Install path: SALOME documentation")
129 # Specific to JOBMANAGER:
130 SET(SALOME_JOBMANAGER_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/jobmanager" CACHE PATH
131 "Install path: SALOME JOBMANAGER specific data")
133 MARK_AS_ADVANCED(SALOME_INSTALL_BINS SALOME_INSTALL_LIBS SALOME_INSTALL_IDLS SALOME_INSTALL_HEADERS)
134 MARK_AS_ADVANCED(SALOME_INSTALL_SCRIPT_SCRIPTS SALOME_INSTALL_SCRIPT_DATA SALOME_INSTALL_SCRIPT_PYTHON)
135 MARK_AS_ADVANCED(SALOME_INSTALL_APPLISKEL_SCRIPTS SALOME_INSTALL_APPLISKEL_PYTHON SALOME_INSTALL_CMAKE_LOCAL SALOME_INSTALL_RES)
136 MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON SALOME_INSTALL_PYTHON_SHARED)
137 MARK_AS_ADVANCED(SALOME_INSTALL_AMCONFIG_LOCAL SALOME_INSTALL_DOC)
138 MARK_AS_ADVANCED(SALOME_JOBMANAGER_INSTALL_RES_DATA)
143 ADD_SUBDIRECTORY(idl)
144 ADD_SUBDIRECTORY(adm_local)
145 ADD_SUBDIRECTORY(src)
147 ADD_SUBDIRECTORY(doc)
148 ENDIF(SALOME_BUILD_DOC)
150 # Header configuration
151 # ====================
152 SALOME_XVERSION(${PROJECT_NAME})
153 SALOME_CONFIGURE_FILE(JOBMANAGER_version.h.in JOBMANAGER_version.h INSTALL ${SALOME_INSTALL_HEADERS})
155 # Configuration export
156 # (here only the level 1 prerequisites are exposed)
157 # ====================
158 INCLUDE(CMakePackageConfigHelpers)
160 # List of targets in this project we want to make visible to the rest of the world.
161 # They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup"
162 SET(_${PROJECT_NAME}_exposed_targets
163 BL_Bases BL_Engine BL_GenericGui JOBMANAGER BL_Wrappers_Qt BL_Wrappers_SALOME JOBMANAGER_IDL
166 # Add all targets to the build-tree export set
167 EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets}
168 FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
170 # Create the configuration files:
171 # - in the build tree:
173 # Ensure the variables are always defined for the configure:
174 SET(GUI_ROOT_DIR "${GUI_ROOT_DIR}")
176 SET(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include")
177 CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in
178 ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
179 INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
180 PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX
183 WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
184 VERSION ${${PROJECT_NAME_UC}_VERSION}
185 COMPATIBILITY AnyNewerVersion)
187 # Install the CMake configuration files:
189 "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
190 "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
191 DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}")
193 # Install the export set for use with the install-tree
194 INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
195 FILE ${PROJECT_NAME}Targets.cmake)