X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cc88d06e4fd1c32dddf17295ff750c60792588e5..3a987e0a881dc1a0bb5a6203814f7960a5f4b07e:/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 1af66cbd8e..06992c338e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -137,12 +137,19 @@ if(NOT PERL_FOUND) endif() # tesh.py needs python 3 (or the module python-subprocess32 on python2.8+) -set(PythonInterp_FIND_VERSION 3) -set(PythonInterp_FIND_VERSION_COUNT 1) -set(PythonInterp_FIND_VERSION_MAJOR 3) -include(FindPythonInterp) -if(NOT PYTHONINTERP_FOUND) - message(FATAL_ERROR "Please install Python (version 3 or higher) to compile SimGrid.") +if(CMAKE_VERSION VERSION_LESS "3.12") + set(PythonInterp_FIND_VERSION 3) + set(PythonInterp_FIND_VERSION_COUNT 1) + set(PythonInterp_FIND_VERSION_MAJOR 3) + include(FindPythonInterp) + if(NOT PYTHONINTERP_FOUND) + message(FATAL_ERROR "Please install Python (version 3 or higher) to compile SimGrid.") + endif() +else() + find_package(Python3) + if(NOT Python3_FOUND) + message(FATAL_ERROR "Please install Python (version 3 or higher) to compile SimGrid.") + endif() endif() SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib) @@ -800,7 +807,7 @@ if((NOT DEFINED enable_python) OR enable_python) set(pybind11_FOUND ON) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_HOME_DIRECTORY}/pybind11/tools/) - set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4) + set(Python_ADDITIONAL_VERSIONS 3.9 3.8 3.7 3.6 3.5 3.4) find_package(PythonLibsNew ${PYBIND11_PYTHON_VERSION} REQUIRED) else()