X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=salome_adm%2Fcmake_files%2FFindSalomeSphinx.cmake;h=78378d6084b378ebc55925e08b9b813cee7e267e;hb=63414a08d9492c25c206579c1953ec6f390679fd;hp=3aa6527e7cb6a6326da144b9a1efe26ade4f2b69;hpb=2327711cfa31b70d64ffcf23b7a901dad74c0412;p=modules%2Fkernel.git diff --git a/salome_adm/cmake_files/FindSalomeSphinx.cmake b/salome_adm/cmake_files/FindSalomeSphinx.cmake index 3aa6527e7..78378d608 100644 --- a/salome_adm/cmake_files/FindSalomeSphinx.cmake +++ b/salome_adm/cmake_files/FindSalomeSphinx.cmake @@ -1,9 +1,9 @@ -# Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE # # 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 @@ -23,4 +23,21 @@ # 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 Docutils installation") + +# Ensure the command is run with the given PYTHONPATH +IF(WIN32 AND NOT CYGWIN) + SET(SPHINX_EXECUTABLE ${SPHINX_EXECUTABLE}) +ELSE() + SET(SPHINX_EXECUTABLE /usr/bin/env PYTHONPATH="${SPHINX_PYTHONPATH}:$$PYTHONPATH" ${SPHINX_EXECUTABLE}) +ENDIF() + MARK_AS_ADVANCED(SPHINX_EXECUTABLE) + +IF(SPHINX_FOUND) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${SPHINX_EXECUTABLE}) + SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${SPHINX_PYTHONPATH}) +ENDIF()