From 55f601c709179ca04e17bc1e184b127dccfb4979 Mon Sep 17 00:00:00 2001 From: bruneton Date: Tue, 9 Jul 2013 07:45:09 +0000 Subject: [PATCH] Fixed MEDFile detection files installation. Provided the ability to override the PYTHONPATH for the run of SPHINX. Exposed OMNIORBPY_PYTHONPATH giving the path to the Python modules for OmniORB. --- CMakeLists.txt | 3 +++ salome_adm/cmake_files/FindOmniORB.cmake | 6 ------ salome_adm/cmake_files/FindOmniORBPy.cmake | 14 +++----------- salome_adm/cmake_files/FindSalomeSphinx.cmake | 12 ++++++++++++ salome_adm/cmake_files/FindSphinx.cmake | 1 + 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 215944d02..0ecedd428 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,6 +102,9 @@ ENDIF() IF(SALOME_BUILD_DOC) FIND_PACKAGE(SalomeDoxygen REQUIRED) FIND_PACKAGE(SalomeGraphviz) # Remains optional even here. + + # Sphinx needs to run with a specific PYTHONPATH: + #SET(SPHINX_PYTHONPATH "${OMNIORBPY_PYTHONPATH}") FIND_PACKAGE(SalomeSphinx REQUIRED) ENDIF() diff --git a/salome_adm/cmake_files/FindOmniORB.cmake b/salome_adm/cmake_files/FindOmniORB.cmake index 501ca5e96..11504fa09 100644 --- a/salome_adm/cmake_files/FindOmniORB.cmake +++ b/salome_adm/cmake_files/FindOmniORB.cmake @@ -7,7 +7,6 @@ # OMNIORB_VERSION - OmniORB4 version # OMNIORB_IDL_COMPILER - OmniORB4 idl compiler command (omniidl) # OMNIORB_NAMESERVER - OmniORB4 CORBA naming service (omniNames) -# OMNIORB_PYTHON_BACKEND # and many other mainly used in UseOmniORB.cmake # # Detection is made through calls to @@ -127,12 +126,7 @@ ELSE() ENDIF( EXISTS ${OMNIORB_INCLUDE_DIR}/omniORB4/acconfig.h ) SET(OMNIORB_IDLCXXFLAGS -Wba -nf) -#SET(OMNIORB_IDLPYFLAGS -bpython) -#IF (OMNIORB_PYTHON_BACKEND) - #SET(OMNIORB_IDLPYFLAGS "-p ${OMNIORB_PYTHON_BACKEND} ${OMNIORB_IDLPYFLAGS}") -#ENDIF() SET(IDLCXXFLAGS ${OMNIORB_IDLCXXFLAGS}) -#SET(IDLPYFLAGS ${OMNIORB_IDLPYFLAGS}) SET(IDL_CLN_H .hh) SET(IDL_SRV_H .hh) SET(OMNIORB_DEFINITIONS "-D__x86__ -DCOMP_CORBA_DOUBLE -DCOMP_CORBA_LONG") diff --git a/salome_adm/cmake_files/FindOmniORBPy.cmake b/salome_adm/cmake_files/FindOmniORBPy.cmake index 7a1c728eb..fd6a2cca3 100644 --- a/salome_adm/cmake_files/FindOmniORBPy.cmake +++ b/salome_adm/cmake_files/FindOmniORBPy.cmake @@ -2,6 +2,7 @@ # # Sets the following variables: # OMNIORB_PYTHON_BACKEND - path to the Python backend +# OMNIORBPY_PYTHONPATH - Python path to the OmniORB modules # # Detection is made by looking for # lib/python${_py_version}/site-packages/omniidl_be/python.py @@ -50,22 +51,13 @@ ENDIF() ############################################################################## MARK_AS_ADVANCED(OMNIORB_PYTHON_BACKEND) -#SET(OMNIORB_IDLCXXFLAGS -Wba -nf) SET(OMNIORB_IDLPYFLAGS -bpython) IF (OMNIORB_PYTHON_BACKEND) SET(OMNIORB_IDLPYFLAGS "-p ${OMNIORB_PYTHON_BACKEND} ${OMNIORB_IDLPYFLAGS}") ENDIF() -#SET(IDLCXXFLAGS ${OMNIORB_IDLCXXFLAGS}) SET(IDLPYFLAGS ${OMNIORB_IDLPYFLAGS}) -#SET(IDL_CLN_H .hh) -#SET(IDL_SRV_H .hh) -#SET(OMNIORB_DEFINITIONS "-D__x86__ -DCOMP_CORBA_DOUBLE -DCOMP_CORBA_LONG") -#IF(WIN32) -# SET(OMNIORB_DEFINITIONS "${OMNIORB_DEFINITIONS} -D__WIN32__") -#ENDIF() -#IF(APPLE) - #SET(OMNIORB_DEFINITIONS "${OMNIORB_DEFINITIONS} -D__macos__")#for omnithread.h to be checked... -#ENDIF() + +GET_FILENAME_COMPONENT(OMNIORBPY_PYTHONPATH "${OMNIORB_PYTHON_BACKEND}" PATH) # Handle standard arguments: INCLUDE(FindPackageHandleStandardArgs) diff --git a/salome_adm/cmake_files/FindSalomeSphinx.cmake b/salome_adm/cmake_files/FindSalomeSphinx.cmake index 3aa6527e7..f769a43cb 100644 --- a/salome_adm/cmake_files/FindSalomeSphinx.cmake +++ b/salome_adm/cmake_files/FindSalomeSphinx.cmake @@ -21,6 +21,18 @@ # # !! Please read the generic detection procedure in SalomeMacros.cmake !! # +# The caller of this macro might set SPHINX_PYTHONPATH to provide a PYTHONPATH with +# which the sphinx command should be ran. +# SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Sphinx SPHINX_EXECUTABLE 2) + +# Ensure the command is run with the given PYTHONPATH +IF(WIN32 AND NOT CYGWIN) + MESSAGE(WARNING "Sphinx windows command needs a proper PYTHONPATH to run.") +ELSE() + SET(SPHINX_EXECUTABLE /usr/bin/env PYTHONPATH="${SPHINX_PYTHONPATH}:$ENV{PYTHONPATH}" ${SPHINX_EXECUTABLE}) +ENDIF() + MARK_AS_ADVANCED(SPHINX_EXECUTABLE) +#message("SPHINX_EXECUTABLE : ${SPHINX_EXECUTABLE}") diff --git a/salome_adm/cmake_files/FindSphinx.cmake b/salome_adm/cmake_files/FindSphinx.cmake index ac0c954ee..8e05c7a73 100644 --- a/salome_adm/cmake_files/FindSphinx.cmake +++ b/salome_adm/cmake_files/FindSphinx.cmake @@ -1,6 +1,7 @@ # - Sphinx detection # # Output variable: SPHINX_EXECUTABLE +# # # The executable 'sphinx-build' is looked for and returned in the above variable. # -- 2.39.2