#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
-PROJECT(SalomeJOBMANAGER C CXX)
-
-# Ensure a proper linker behavior:
-CMAKE_POLICY(SET CMP0003 NEW)
-
-# 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 4)
-SET(${PROJECT_NAME_UC}_PATCH_VERSION 1)
-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)
-
-# 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})
-
-# 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
-# ============
-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:
-##
+# SALOME_CONFIGURE_FILE(conf.py.in conf.py)
-# Various
-# Boost
-FIND_PACKAGE(SalomeBoost REQUIRED)
-# CORBA
-FIND_PACKAGE(SalomeOmniORB REQUIRED)
+# SET(_cmd_options -c ${CMAKE_CURRENT_BINARY_DIR} -b html -d doctrees -D latex_paper_size=a4 ${CMAKE_CURRENT_SOURCE_DIR} html)
+# SALOME_GENERATE_ENVIRONMENT_SCRIPT(_cmd env_script "${SPHINX_EXECUTABLE}" "${_cmd_options}")
+
+# ADD_CUSTOM_TARGET(html_docs COMMAND ${_cmd})
+
+# INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target html_docs)")
+# INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ DESTINATION ${SALOME_INSTALL_DOC}/gui/JOBMANAGER)
+
+# SET(make_clean_files html doctrees)
+# SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${make_clean_files}")
+
+
+
+
+#------------------------------------
+SALOME_CONFIGURE_FILE(conf.py.in conf.py)
+
+IF(NOT WIN32)
+
+ SET(_cmd_options -c ${CMAKE_CURRENT_BINARY_DIR} -b html -d doctrees -D latex_paper_size=a4 ${CMAKE_CURRENT_SOURCE_DIR} html)
+ SALOME_GENERATE_ENVIRONMENT_SCRIPT(_cmd env_script "${SPHINX_EXECUTABLE}" "${_cmd_options}")
+
+ELSE()
+
+ SET(_cmd_options -c ${CMAKE_CURRENT_BINARY_DIR} -b html -d doctrees -D latex_paper_size=a4 ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/html)
+ # SET(_cmd_options -c ${CMAKE_CURRENT_BINARY_DIR} -b html -d doctrees -D latex_paper_size=a4 ${CMAKE_CURRENT_SOURCE_DIR} html)
+ EXECUTE_PROCESS(COMMAND ${SPHINX_EXECUTABLE} ${_cmd_options})
-# Other KERNEL optionals:
-IF(SALOME_USE_MPI)
- FIND_PACKAGE(SalomeMPI) # needed for doc generation by Sphinx
-ENDIF()
-IF(SALOME_BUILD_DOC)
- FIND_PACKAGE(SalomeSphinx)
- SALOME_LOG_OPTIONAL_PACKAGE(Sphinx SALOME_BUILD_DOC)
ENDIF()
-# Find GUI
-# ===========
-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})
-ELSE(EXISTS ${GUI_ROOT_DIR})
- 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})
-
-# Detection summary:
-SALOME_PACKAGE_REPORT_AND_CHECK()
-
-# Directories
-# (default values taken from KERNEL)
-# ===========
-SET(SALOME_INSTALL_BINS "${SALOME_INSTALL_BINS}" CACHE PATH "Install path: SALOME binaries")
-SET(SALOME_INSTALL_LIBS "${SALOME_INSTALL_LIBS}" CACHE PATH "Install path: SALOME libs")
-SET(SALOME_INSTALL_IDLS "${SALOME_INSTALL_IDLS}" CACHE PATH "Install path: SALOME IDL files")
-SET(SALOME_INSTALL_HEADERS "${SALOME_INSTALL_HEADERS}" CACHE PATH "Install path: SALOME headers")
-SET(SALOME_INSTALL_SCRIPT_SCRIPTS "${SALOME_INSTALL_SCRIPT_SCRIPTS}" CACHE PATH
- "Install path: SALOME scripts")
-SET(SALOME_INSTALL_SCRIPT_DATA "${SALOME_INSTALL_SCRIPT_DATA}" CACHE PATH
- "Install path: SALOME script data")
-SET(SALOME_INSTALL_SCRIPT_PYTHON "${SALOME_INSTALL_SCRIPT_PYTHON}" CACHE PATH
- "Install path: SALOME Python scripts")
-SET(SALOME_INSTALL_APPLISKEL_SCRIPTS "${SALOME_INSTALL_APPLISKEL_SCRIPTS}" CACHE PATH
- "Install path: SALOME application skeleton - scripts")
-SET(SALOME_INSTALL_APPLISKEL_PYTHON "${SALOME_INSTALL_APPLISKEL_PYTHON}" CACHE PATH
- "Install path: SALOME application skeleton - Python")
-SET(SALOME_INSTALL_PYTHON "${SALOME_INSTALL_PYTHON}" CACHE PATH "Install path: SALOME Python stuff")
-SET(SALOME_INSTALL_PYTHON_SHARED "${SALOME_INSTALL_PYTHON_SHARED}" CACHE PATH
- "Install path: SALOME Python shared modules")
-SET(SALOME_INSTALL_CMAKE_LOCAL "${SALOME_INSTALL_CMAKE_LOCAL}" CACHE PATH
- "Install path: local SALOME CMake files")
-SET(SALOME_INSTALL_AMCONFIG_LOCAL "${SALOME_INSTALL_AMCONFIG_LOCAL}" CACHE PATH
- "Install path: local SALOME config files (obsolete, to be removed)")
-SET(SALOME_INSTALL_RES "${SALOME_INSTALL_RES}" CACHE PATH "Install path: SALOME resources")
-SET(SALOME_INSTALL_DOC "${SALOME_INSTALL_DOC}" CACHE PATH "Install path: SALOME documentation")
-
-# Specific to JOBMANAGER:
-SET(SALOME_JOBMANAGER_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/jobmanager" CACHE PATH
- "Install path: SALOME JOBMANAGER specific data")
-
-MARK_AS_ADVANCED(SALOME_INSTALL_BINS SALOME_INSTALL_LIBS SALOME_INSTALL_IDLS SALOME_INSTALL_HEADERS)
-MARK_AS_ADVANCED(SALOME_INSTALL_SCRIPT_SCRIPTS SALOME_INSTALL_SCRIPT_DATA SALOME_INSTALL_SCRIPT_PYTHON)
-MARK_AS_ADVANCED(SALOME_INSTALL_APPLISKEL_SCRIPTS SALOME_INSTALL_APPLISKEL_PYTHON SALOME_INSTALL_CMAKE_LOCAL SALOME_INSTALL_RES)
-MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON SALOME_INSTALL_PYTHON_SHARED)
-MARK_AS_ADVANCED(SALOME_INSTALL_AMCONFIG_LOCAL SALOME_INSTALL_DOC)
-MARK_AS_ADVANCED(SALOME_JOBMANAGER_INSTALL_RES_DATA)
-
-# Accumulate environment variables for JOBMANAGER module
-SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_BINS})
-SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS})
-
-# Sources
-# ========
-
-ADD_SUBDIRECTORY(idl)
-ADD_SUBDIRECTORY(adm_local)
-ADD_SUBDIRECTORY(src)
-IF(SALOME_BUILD_DOC)
- ADD_SUBDIRECTORY(doc)
-ENDIF(SALOME_BUILD_DOC)
-
-# Header configuration
-# ====================
-SALOME_XVERSION(${PROJECT_NAME})
-SALOME_CONFIGURE_FILE(JOBMANAGER_version.h.in JOBMANAGER_version.h INSTALL ${SALOME_INSTALL_HEADERS})
-
-# Configuration export
-# (here only the level 1 prerequisites are exposed)
-# ====================
-INCLUDE(CMakePackageConfigHelpers)
-
-# List of targets in this project we want to make visible to the rest of the world.
-# They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup"
-SET(_${PROJECT_NAME}_exposed_targets
- BL_Bases BL_Engine BL_GenericGui JOBMANAGER BL_Wrappers_Qt BL_Wrappers_SALOME JOBMANAGER_IDL
-)
-
-# Add all targets to the build-tree export set
-EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets}
- FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
-
-# Create the configuration files:
-# - in the build tree:
-
-# Ensure the variables are always defined for the configure:
-SET(GUI_ROOT_DIR "${GUI_ROOT_DIR}")
-
-SET(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include")
-
-# Build variables that will be expanded when configuring Salome<MODULE>Config.cmake:
-# SALOME_CONFIGURE_PREPARE() #For use in the future
-
-CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in
- ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
- INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
- PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX
- GUI_ROOT_DIR)
-
-WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
- VERSION ${${PROJECT_NAME_UC}_VERSION}
- COMPATIBILITY AnyNewerVersion)
-
-# Install the CMake configuration files:
-INSTALL(FILES
- "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
- "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
- DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}")
-
-# Install the export set for use with the install-tree
-INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
- FILE ${PROJECT_NAME}Targets.cmake)
+ADD_CUSTOM_TARGET(html_docs COMMAND ${_cmd})
+
+INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target html_docs)")
+INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ DESTINATION ${SALOME_INSTALL_DOC}/gui/JOBMANAGER)
+
+SET(make_clean_files html doctrees)
+SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${make_clean_files}")
+
+