From 76b9b23c617b8e234a428670e5516931f82169e6 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 11 Feb 2016 17:20:54 +0300 Subject: [PATCH] Merge relevant changes from V8_0_0_BR branch --- CMakeLists.txt | 3 +-- MEDCoupling_version.h.in | 2 -- cmake_files/FindSphinx.cmake | 11 +++++++++++ cmake_files/SalomeMacros.cmake | 32 ++++++++++++++++++-------------- doc/tutorial/conf.py.in | 2 +- 5 files changed, 31 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 914265bce..22e4adb21 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -180,8 +180,7 @@ MARK_AS_ADVANCED(MEDCOUPLING_INSTALL_PYTHON MEDCOUPLING_INSTALL_PYTHON_SHARED ME # Header configuration # ==================== SALOME_XVERSION(${PROJECT_NAME}) -SALOME_CONFIGURE_FILE(MEDCoupling_version.h.in MEDCoupling_version.h INSTALL ${SALOME_INSTALL_HEADERS}) -#SALOME_CONFIGURE_FILE(VERSION.in VERSION INSTALL ${SALOME_INSTALL_BINS}) +SALOME_CONFIGURE_FILE(MEDCoupling_version.h.in MEDCoupling_version.h INSTALL ${MEDCOUPLING_INSTALL_HEADERS}) # Accumulate environment variables for MED module #SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_BINS} diff --git a/MEDCoupling_version.h.in b/MEDCoupling_version.h.in index e81ace123..071dca531 100644 --- a/MEDCoupling_version.h.in +++ b/MEDCoupling_version.h.in @@ -31,7 +31,6 @@ MEDCOUPLING_VERSION_MAINTENANCE : (integer) number identifying maintenance version MEDCOUPLING_VERSION_STR : (string) complete version number "major.minor.maintenance" MEDCOUPLING_VERSION : (hex) complete version number (major << 16) + (minor << 8) + maintenance - MEDCOUPLING_DEVELOPMENT : (integer) indicates development version when set to 1 */ #define MEDCOUPLING_VERSION_MAJOR @MEDCOUPLING_MAJOR_VERSION@ @@ -39,6 +38,5 @@ #define MEDCOUPLING_VERSION_MAINTENANCE @MEDCOUPLING_PATCH_VERSION@ #define MEDCOUPLING_VERSION_STR "@MEDCOUPLING_VERSION@" #define MEDCOUPLING_VERSION @MEDCOUPLING_XVERSION@ -#define MEDCOUPLING_DEVELOPMENT @MEDCOUPLING_VERSION_DEV@ #endif // __MEDCOUPLING_VERSION_H__ diff --git a/cmake_files/FindSphinx.cmake b/cmake_files/FindSphinx.cmake index 1c9c6a8fd..648d1707b 100644 --- a/cmake_files/FindSphinx.cmake +++ b/cmake_files/FindSphinx.cmake @@ -38,7 +38,18 @@ IF(WIN32) ELSE() SET(SPHINX_PYTHONPATH "${_tmp_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages") ENDIF() + # Handle the standard arguments of the find_package() command: INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sphinx REQUIRED_VARS SPHINX_EXECUTABLE SPHINX_APIDOC_EXECUTABLE) +IF(SPHINX_EXECUTABLE) + EXECUTE_PROCESS(COMMAND ${SPHINX_EXECUTABLE} "--version" OUTPUT_VARIABLE SPHINX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) + STRING(REGEX REPLACE ".* ([0-9.]+)$" "\\1" SPHINX_VERSION "${SPHINX_VERSION}" ) + MESSAGE(STATUS "Sphinx version is ${SPHINX_VERSION}") + IF(SPHINX_VERSION VERSION_LESS "1.3") + SET(SPHINX_THEME "basic") + ELSE() + SET(SPHINX_THEME "classic") + ENDIF() +ENDIF(SPHINX_EXECUTABLE) diff --git a/cmake_files/SalomeMacros.cmake b/cmake_files/SalomeMacros.cmake index 25a22bdf7..34f85786d 100644 --- a/cmake_files/SalomeMacros.cmake +++ b/cmake_files/SalomeMacros.cmake @@ -473,6 +473,7 @@ MACRO(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS pkg referenceVariable upCount) ## ## 0. Initialization ## + PARSE_ARGUMENTS(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS "ENVVAR" "" ${ARGN}) # Package name, upper case STRING(TOUPPER ${pkg} pkg_UC) @@ -480,22 +481,25 @@ MACRO(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS pkg referenceVariable upCount) ## ## 1. Load environment or any previously detected root dir for the package ## - IF(DEFINED ENV{${pkg_UC}_ROOT_DIR}) - FILE(TO_CMAKE_PATH "$ENV{${pkg_UC}_ROOT_DIR}" _${pkg_UC}_ROOT_DIR_ENV) + SET(_envvar ${pkg_UC}_ROOT_DIR) + IF(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS_ENVVAR) + SET(_envvar "${SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS_ENVVAR}") + ENDIF() + IF(DEFINED ENV{${_envvar}}) + FILE(TO_CMAKE_PATH "$ENV{${_envvar}}" _${pkg_UC}_ROOT_DIR_ENV) SET(_dflt_value "${_${pkg_UC}_ROOT_DIR_ENV}") ELSE() # will be blank if no package was previously loaded: SET(_dflt_value "${${pkg_UC}_ROOT_DIR_EXP}") ENDIF() - # Detect if the variable has been set on the command line or elsewhere: - IF(DEFINED ${pkg_UC}_ROOT_DIR) + IF(DEFINED ${_envvar}) SET(_var_already_there TRUE) ELSE() SET(_var_already_there FALSE) ENDIF() # Make cache entry - SET(${pkg_UC}_ROOT_DIR "${_dflt_value}" CACHE PATH "Path to ${pkg_UC} directory") + SET(${_envvar} "${_dflt_value}" CACHE PATH "Path to ${pkg_UC} directory") ## ## 2. Find package - try CONFIG mode first (i.e. looking for XYZ-config.cmake) @@ -503,8 +507,8 @@ MACRO(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS pkg referenceVariable upCount) # Override the variable - don't append to it, as it would give precedence # to what was stored there before! - IF(DEFINED ${pkg_UC}_ROOT_DIR) - SET(CMAKE_PREFIX_PATH "${${pkg_UC}_ROOT_DIR}") + IF(DEFINED ${_envvar}) + SET(CMAKE_PREFIX_PATH "${${_envvar}}") ENDIF() # Try find_package in config mode. This has the priority, but is @@ -531,11 +535,11 @@ MACRO(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS pkg referenceVariable upCount) IF(NOT Salome${pkg}_FIND_QUIETLY) IF(Salome${pkg}_FIND_REQUIRED) MESSAGE(FATAL_ERROR "Package ${pkg} couldn't be found - did you set the corresponing root dir correctly? " - "It currently contains ${pkg_UC}_ROOT_DIR=${${pkg_UC}_ROOT_DIR} " + "It currently contains ${_envvar}=${${_envvar}} " "Append -DSALOME_CMAKE_DEBUG=ON on the command line if you want to see the original CMake error.") ELSE() MESSAGE(WARNING "Package ${pkg} couldn't be found - did you set the corresponing root dir correctly? " - "It currently contains ${pkg_UC}_ROOT_DIR=${${pkg_UC}_ROOT_DIR} " + "It currently contains ${_envvar}=${${_envvar}} " "Append -DSALOME_CMAKE_DEBUG=ON on the command line if you want to see the original CMake error.") ENDIF() ENDIF() @@ -568,19 +572,19 @@ MACRO(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS pkg referenceVariable upCount) ## ## 4. Warn if CMake found something not located under ENV(XYZ_ROOT_DIR) ## - IF(DEFINED ENV{${pkg_UC}_ROOT_DIR}) + IF(DEFINED ENV{${_envvar}}) SALOME_CHECK_EQUAL_PATHS(_res "${_tmp_ROOT_DIR}" "${_${pkg_UC}_ROOT_DIR_ENV}") IF(NOT _res) MESSAGE(WARNING "${pkg} was found, but not at the path given by the " - "environment ${pkg_UC}_ROOT_DIR! Is the variable correctly set? " + "environment ${_envvar}! Is the variable correctly set? " "The two paths are: ${_tmp_ROOT_DIR} and: ${_${pkg_UC}_ROOT_DIR_ENV}") ELSE() - MESSAGE(STATUS "${pkg} found directory matches what was specified in the ${pkg_UC}_ROOT_DIR variable, all good!") + MESSAGE(STATUS "${pkg} found directory matches what was specified in the ${_envvar} variable, all good!") ENDIF() ELSE() IF(NOT _var_already_there) - MESSAGE(STATUS "Variable ${pkg_UC}_ROOT_DIR was not explicitly defined. " + MESSAGE(STATUS "Variable ${_envvar} was not explicitly defined. " "An installation was found anyway: ${_tmp_ROOT_DIR}") ENDIF() ENDIF() @@ -602,7 +606,7 @@ MACRO(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS pkg referenceVariable upCount) ## ## 6. Save the detected installation ## - SET(${pkg_UC}_ROOT_DIR "${_tmp_ROOT_DIR}") + SET(${_envvar} "${_tmp_ROOT_DIR}") ELSE() MESSAGE(STATUS "${pkg} was not found.") diff --git a/doc/tutorial/conf.py.in b/doc/tutorial/conf.py.in index 7cb16dd10..ee9295d31 100644 --- a/doc/tutorial/conf.py.in +++ b/doc/tutorial/conf.py.in @@ -88,7 +88,7 @@ pygments_style = 'sphinx' # Options for HTML output # ----------------------- -html_theme = 'basic' +html_theme = '@SPHINX_THEME@' # The style sheet to use for HTML and HTML Help pages. A file of that name # must exist either in Sphinx' static/ path, or in one of the custom paths -- 2.39.2