-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2021 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
+
+# Project name
+# ============
+# original
PROJECT(SalomeJOBMANAGER C CXX)
+# upper case
+STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
-# Ensure a proper linker behavior:
-CMAKE_POLICY(SET CMP0003 NEW)
+# Common CMake macros
+# ===================
+SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake configuration files")
+IF(EXISTS ${CONFIGURATION_ROOT_DIR})
+ LIST(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake")
+ INCLUDE(SalomeMacros NO_POLICY_SCOPE)
+ELSE()
+ MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !")
+ENDIF()
# Versioning
# ===========
-# Project name, upper case
-STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
-
-SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 2)
-SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
-SET(${PROJECT_NAME_UC}_VERSION
- ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
-SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
+SALOME_SETUP_VERSION(9.8.0 DEVELOPMENT)
+MESSAGE(STATUS "Building ${PROJECT_NAME_UC} ${${PROJECT_NAME_UC}_VERSION} from \"${${PROJECT_NAME_UC}_GIT_SHA1}\"")
# Find KERNEL
# ===========
SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL")
IF(EXISTS ${KERNEL_ROOT_DIR})
- LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
- INCLUDE(SalomeMacros)
FIND_PACKAGE(SalomeKERNEL REQUIRED)
+ KERNEL_WITH_CORBA() # check whether KERNEL builded with CORBA
ELSE(EXISTS ${KERNEL_ROOT_DIR})
MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR")
ENDIF(EXISTS ${KERNEL_ROOT_DIR})
-IF(SALOME_LIGHT_ONLY)
- MESSAGE(FATAL_ERROR "JOBMANAGER module can't be built in Light mode (without CORBA)")
-ENDIF()
-
# Platform setup
# ==============
INCLUDE(SalomeSetupPlatform) # From KERNEL
# Always build libraries as shared objects:
SET(BUILD_SHARED_LIBS TRUE)
-# Local macros:
-LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local/cmake_files")
# User options
-# (some options have already been defined in KERNEL)
# ============
-#OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON) #for use in the future
+OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON)
OPTION(SALOME_BUILD_DOC "Generate SALOME JOBMANAGER documentation" ON)
+IF(SALOME_BUILD_TESTS)
+ ENABLE_TESTING()
+ENDIF()
+
##
## From KERNEL:
##
FIND_PACKAGE(SalomeMPI) # needed for doc generation by Sphinx
ENDIF()
IF(SALOME_BUILD_DOC)
+
+ # Python: should be detected before sphinx
+ FIND_PACKAGE(SalomePythonInterp REQUIRED)
+ FIND_PACKAGE(SalomePythonLibs REQUIRED)
+
FIND_PACKAGE(SalomeSphinx)
SALOME_LOG_OPTIONAL_PACKAGE(Sphinx SALOME_BUILD_DOC)
ENDIF()
# ===========
SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR} CACHE PATH "Path to the Salome GUI")
IF(EXISTS ${GUI_ROOT_DIR})
- LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files")
FIND_PACKAGE(SalomeGUI REQUIRED)
ADD_DEFINITIONS(${GUI_DEFINITIONS})
INCLUDE_DIRECTORIES(${GUI_INCLUDE_DIRS})
MESSAGE(FATAL_ERROR "We absolutely need a Salome GUI, please define GUI_ROOT_DIR")
ENDIF(EXISTS ${GUI_ROOT_DIR})
-# Qt4
-FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml)
-INCLUDE(${QT_USE_FILE})
+# Qt
+FIND_PACKAGE(SalomeQt5 REQUIRED)
# Detection summary:
SALOME_PACKAGE_REPORT_AND_CHECK()
# Header configuration
# ====================
-SALOME_XVERSION(${PROJECT_NAME})
SALOME_CONFIGURE_FILE(JOBMANAGER_version.h.in JOBMANAGER_version.h INSTALL ${SALOME_INSTALL_HEADERS})
# Configuration export