use new way to find python3 since cmake 3.12 and do not use old python path

This commit is contained in:
Sébastien Loriot 2021-09-21 14:40:45 +02:00
parent 713467e952
commit c83057a7dc
2 changed files with 8 additions and 10 deletions

View File

@ -27,7 +27,7 @@ else()
endif() endif()
find_package(Doxygen) find_package(Doxygen)
find_package(PythonInterp 3.5) find_package(Python3 COMPONENTS Interpreter)
if(NOT DOXYGEN_FOUND) if(NOT DOXYGEN_FOUND)
message(WARNING "Cannot build the documentation without Doxygen!") message(WARNING "Cannot build the documentation without Doxygen!")
@ -322,9 +322,9 @@ endif()
set(CGAL_DOC_VERSION ${CGAL_CREATED_VERSION_NUM}) set(CGAL_DOC_VERSION ${CGAL_CREATED_VERSION_NUM})
## generate how_to_cite files ## generate how_to_cite files
if(PYTHONINTERP_FOUND) if(Python3_Interpreter_FOUND)
execute_process( execute_process(
COMMAND ${PYTHON_EXECUTABLE} ${CGAL_DOC_SCRIPT_DIR}/generate_how_to_cite.py COMMAND ${Python3_EXECUTABLE} ${CGAL_DOC_SCRIPT_DIR}/generate_how_to_cite.py
${CGAL_ROOT} ${CMAKE_BINARY_DIR} "${CGAL_BRANCH_BUILD}" ${CGAL_ROOT} ${CMAKE_BINARY_DIR} "${CGAL_BRANCH_BUILD}"
RESULT_VARIABLE GENERATE_HOW_TO_CITE_RESULT) RESULT_VARIABLE GENERATE_HOW_TO_CITE_RESULT)
if(NOT GENERATE_HOW_TO_CITE_RESULT EQUAL "0") if(NOT GENERATE_HOW_TO_CITE_RESULT EQUAL "0")
@ -436,25 +436,25 @@ add_dependencies(Documentation_copy_doc_tags doc_pre)
#total level doc dependencies #total level doc dependencies
add_dependencies(doc doc_post) add_dependencies(doc doc_post)
if(PYTHONINTERP_FOUND) if(Python3_Interpreter_FOUND)
set(CGAL_DOC_TESTSUITE_SCRIPT "${CGAL_DOC_SCRIPT_DIR}/testsuite.py") set(CGAL_DOC_TESTSUITE_SCRIPT "${CGAL_DOC_SCRIPT_DIR}/testsuite.py")
add_custom_target( add_custom_target(
doc_with_postprocessing doc_with_postprocessing
${PYTHON_EXECUTABLE} ${CGAL_DOC_SCRIPT_DIR}/html_output_post_processing.py ${Python3_EXECUTABLE} ${CGAL_DOC_SCRIPT_DIR}/html_output_post_processing.py
--output ${CGAL_DOC_OUTPUT_DIR} --resources ${CGAL_DOC_RESOURCE_DIR}) --output ${CGAL_DOC_OUTPUT_DIR} --resources ${CGAL_DOC_RESOURCE_DIR})
add_dependencies(doc_with_postprocessing doc) add_dependencies(doc_with_postprocessing doc)
if(CGAL_DOC_CREATE_LOGS) if(CGAL_DOC_CREATE_LOGS)
add_custom_target( add_custom_target(
Documentation_test Documentation_test
${PYTHON_EXECUTABLE} ${CGAL_DOC_TESTSUITE_SCRIPT} --output-dir ${Python3_EXECUTABLE} ${CGAL_DOC_TESTSUITE_SCRIPT} --output-dir
${CGAL_DOC_OUTPUT_DIR} --doc-log-dir ${CGAL_DOC_LOG_DIR}) ${CGAL_DOC_OUTPUT_DIR} --doc-log-dir ${CGAL_DOC_LOG_DIR})
add_dependencies(Documentation_test doc) add_dependencies(Documentation_test doc)
add_custom_target( add_custom_target(
Documentation_test_publish Documentation_test_publish
${PYTHON_EXECUTABLE} ${Python3_EXECUTABLE}
${CGAL_DOC_TESTSUITE_SCRIPT} ${CGAL_DOC_TESTSUITE_SCRIPT}
--output-dir --output-dir
${CGAL_DOC_OUTPUT_DIR} ${CGAL_DOC_OUTPUT_DIR}
@ -467,7 +467,7 @@ if(PYTHONINTERP_FOUND)
add_custom_target( add_custom_target(
doc_and_publish_testsuite doc_and_publish_testsuite
${PYTHON_EXECUTABLE} ${Python3_EXECUTABLE}
${CGAL_DOC_TESTSUITE_SCRIPT} ${CGAL_DOC_TESTSUITE_SCRIPT}
--output-dir --output-dir
${CGAL_DOC_OUTPUT_DIR} ${CGAL_DOC_OUTPUT_DIR}

View File

@ -58,8 +58,6 @@ if [ ! -d "${CGAL_DOC_BUILD}/${CGAL_RELEASE_ID}" ]; then
fi fi
cd "${CGAL_RELEASE_ID}" cd "${CGAL_RELEASE_ID}"
PYTHONPATH=/home/cgal-testsuite/.local/lib/python2.6/site-packages
export PYTHONPATH
PATH=/home/cgal-testsuite/local/bin:$PATH PATH=/home/cgal-testsuite/local/bin:$PATH
export PATH export PATH
cd "$PWD/doc/scripts" cd "$PWD/doc/scripts"