diff options
author | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2019-04-11 21:43:22 +0200 |
---|---|---|
committer | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2019-04-11 21:43:22 +0200 |
commit | bb685d0dc4f0032374a16dca73b1fb35b8f1722c (patch) | |
tree | 4e733bc7c9e42c258136980741f0a9a435b75204 /src/cmake/modules/GUDHI_third_party_libraries.cmake | |
parent | 28ea9844e4859891851210a0d818259551ab7ace (diff) |
sphinx-build seems to be here on sphinx 2.0.1
Diffstat (limited to 'src/cmake/modules/GUDHI_third_party_libraries.cmake')
-rw-r--r-- | src/cmake/modules/GUDHI_third_party_libraries.cmake | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/src/cmake/modules/GUDHI_third_party_libraries.cmake b/src/cmake/modules/GUDHI_third_party_libraries.cmake index 7fd0b1e4..57ea7d14 100644 --- a/src/cmake/modules/GUDHI_third_party_libraries.cmake +++ b/src/cmake/modules/GUDHI_third_party_libraries.cmake @@ -158,24 +158,16 @@ endif(NOT GUDHI_CYTHON_PATH) option(WITH_GUDHI_CYTHON_RUNTIME_LIBRARY_DIRS "Build with setting runtime_library_dirs. Usefull when setting rpath is not allowed" ON) if(PYTHONINTERP_FOUND AND CYTHON_FOUND) - # Default found version 2 - if(PYTHON_VERSION_MAJOR EQUAL 2) - if(SPHINX_FOUND) - # Documentation generation is available through sphinx - find_program( SPHINX_PATH sphinx-build ) - endif(SPHINX_FOUND) - elseif(PYTHON_VERSION_MAJOR EQUAL 3) - if(SPHINX_FOUND) - # No sphinx-build in Pyton3, just hack it - set(SPHINX_PATH "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/${GUDHI_CYTHON_PATH}/doc/python3-sphinx-build.py") - endif(SPHINX_FOUND) - else() - message(FATAL_ERROR "ERROR: Try to compile the Cython interface. Python version ${PYTHON_VERSION_STRING} is not valid.") - endif(PYTHON_VERSION_MAJOR EQUAL 2) - # get PYTHON_SITE_PACKAGES relative path from a python command line - execute_process( - COMMAND "${PYTHON_EXECUTABLE}" -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(prefix='', plat_specific=True))" - OUTPUT_VARIABLE PYTHON_SITE_PACKAGES - OUTPUT_STRIP_TRAILING_WHITESPACE) + if(SPHINX_FOUND) + # Documentation generation is available through sphinx + find_program( SPHINX_PATH sphinx-build ) + + if(NOT SPHINX_PATH) + if(PYTHON_VERSION_MAJOR EQUAL 3) + # In Python3, just hack sphinx-build if it does not exist + set(SPHINX_PATH "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/${GUDHI_CYTHON_PATH}/doc/python3-sphinx-build.py") + endif(PYTHON_VERSION_MAJOR EQUAL 3) + endif(NOT SPHINX_PATH) + endif(SPHINX_FOUND) endif(PYTHONINTERP_FOUND AND CYTHON_FOUND) |