]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
CMake: Edition accumulation of LD_LIBRARY_PATH and PATH
authormpa <mpa@opencascade.com>
Thu, 31 Oct 2013 06:54:57 +0000 (06:54 +0000)
committermpa <mpa@opencascade.com>
Thu, 31 Oct 2013 06:54:57 +0000 (06:54 +0000)
salome_adm/cmake_files/FindSalomeSphinx.cmake
salome_adm/cmake_files/FindSphinx.cmake

index e1a95474bbc9a2ece2c91825a7b7ac3512eac0eb..f7d625c95acae7d07e558099536c25344d3deb3f 100644 (file)
 #
 #  !! Please read the generic detection procedure in SalomeMacros.cmake !!
 #
-# The caller of this macro might set SPHINX_PYTHONPATH to provide a path to be added in front 
-# of the PYTHONPATH with which the sphinx command should be ran.
-#
-# Note the environment is also overriden in 
-#     doc/docutils/CMakeLists.txt
-# with the creation of a dedicated launcher script.
-#
 
 SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Sphinx SPHINX_EXECUTABLE 2)
 
 # Also retrieve paths to DOCUTILS and SETUPTOOLS:
 SET(SETUPTOOLS_ROOT_DIR "$ENV{SETUPTOOLS_ROOT_DIR}" CACHE PATH "Path to the Setuptools installation")
-SET(DOCUTILS_ROOT_DIR "$ENV{DOCUTILS_ROOT_DIR}" CACHE PATH "Path to the Setuptools installation")
+SET(DOCUTILS_ROOT_DIR "$ENV{DOCUTILS_ROOT_DIR}" CACHE PATH "Path to the Docutils installation")
 
 # Ensure the command is run with the given PYTHONPATH
 IF(WIN32 AND NOT CYGWIN)
@@ -46,9 +39,6 @@ ENDIF()
 MARK_AS_ADVANCED(SPHINX_EXECUTABLE)
 
 IF(SPHINX_FOUND)
-  SALOME_ACCUMULATE_ENVIRONMENT(PATH ${SPHINX_ROOT_DIR}/bin)
-  SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${PYTHON_ROOT_DIR}/lib)
-  SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${SPHINX_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages
-                                           ${SETUPTOOLS_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages
-                                           ${DOCUTILS_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages)
+  SALOME_ACCUMULATE_ENVIRONMENT(PATH ${SPHINX_EXECUTABLE})
+  SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${SPHINX_PYTHONPATH})
 ENDIF()
index f06933ab1a3a66db0e34040ee0966b5fa091dbca..472156bed6565d5571936a60cd2b213f86eac2cf 100644 (file)
@@ -1,11 +1,9 @@
 # - Sphinx detection
 #
-# Output variable: SPHINX_EXECUTABLE
-#                  
+# Output variables:
+#   SPHINX_EXECUTABLE - path to the Sphinx executable
+#   SPHINX_PYTHONPATH - path to the Sphinx Python modules                 
 # 
-# The executable 'sphinx-build' is looked for and returned in the above variable.
-#
-
 ###########################################################################
 # Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 
 FIND_PROGRAM(SPHINX_EXECUTABLE sphinx-build PATH_SUFFIXES Scripts)
 
+# Get root dir locally, going up two levels from the exec:
+GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${SPHINX_EXECUTABLE}" PATH)
+GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${_tmp_ROOT_DIR}" PATH)
+SET(SPHINX_PYTHONPATH "${_tmp_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages")
+
 # Handle the standard arguments of the find_package() command:
 INCLUDE(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sphinx REQUIRED_VARS SPHINX_EXECUTABLE)