diff --git a/CMakeLists.txt b/CMakeLists.txt index 21df0f324439286be105ebe9814e9d6d88b822da..679dbeb46298aeab2a4d1f52373c4c11cd832260 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -235,6 +235,9 @@ option(OGS_ENABLE_ELEMENT_PYRAMID "Build FEM elements for pyramids." ON) option(OGS_CHECK_HEADER_COMPILATION "Check header for standalone compilation." OFF) option(OGS_USE_PYTHON "Interface with Python" OFF) +if(OGS_USE_PYTHON AND NOT Python_FOUND) + message(FATAL_ERROR "Python not found but required for OGS_USE_PYTHON=ON!") +endif() option(OGS_USE_MFRONT "Enable solid material models by MFront (https://tfel.sourceforge.net)" OFF) diff --git a/scripts/cmake/Coverage.cmake b/scripts/cmake/Coverage.cmake index 338782428bc69e50848dfa5cdfdb3c1a82a1c5de..2fd9f9274dc8fce85784e4fd379cc8a5421cfaa2 100644 --- a/scripts/cmake/Coverage.cmake +++ b/scripts/cmake/Coverage.cmake @@ -22,7 +22,7 @@ else() message(STATUS "No lcov coverage report generated because lcov or genhtml was not found.") endif() -if(PYTHON_EXECUTABLE) +if(Python_EXECUTABLE) setup_target_for_coverage_gcovr_xml( NAME testrunner_coverage_cobertura EXECUTABLE ${CMAKE_COMMAND} --build . --target tests diff --git a/scripts/cmake/Find.cmake b/scripts/cmake/Find.cmake index 1eab719e94325ef1dee3346e75d717f5b342ee26..9a608772534843f41ad0d56ae88eaf4bdabbf7f5 100644 --- a/scripts/cmake/Find.cmake +++ b/scripts/cmake/Find.cmake @@ -9,7 +9,7 @@ find_program(GPROF_PATH gprof DOC "GNU profiler gprof" QUIET) find_program(CPPCHECK_TOOL_PATH cppcheck) -find_package(PythonInterp QUIET) +find_package(Python COMPONENTS Interpreter Development) # Find bash itself ... find_program(BASH_TOOL_PATH bash