From 18d427d9b24b682c94530f7ddcc893b0473c414b Mon Sep 17 00:00:00 2001 From: Dominik Thoennes <dominik.thoennes@fau.de> Date: Mon, 22 Nov 2021 10:34:15 +0100 Subject: [PATCH] set new policy to not favor most recent python version --- CMakeLists.txt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c1b77656f..707890fdd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -569,8 +569,17 @@ if ( WALBERLA_CXX_COMPILER_IS_MSVC ) endif ( ) ############################################################################################################################ +############################################################################################################################ +## +## Python +## +############################################################################################################################# - +if ( WALBERLA_BUILD_WITH_CODEGEN OR WALBERLA_BUILD_WITH_PYTHON ) + cmake_policy( SET CMP0094 NEW ) + set( Python_FIND_FRAMEWORK LAST ) + find_package (Python COMPONENTS Interpreter Development) +endif() ############################################################################################################################ ## @@ -578,8 +587,6 @@ endif ( ) ## ############################################################################################################################# if ( WALBERLA_BUILD_WITH_CODEGEN ) - set( Python_FIND_FRAMEWORK LAST ) - find_package (Python COMPONENTS Interpreter Development) execute_process(COMMAND ${Python_EXECUTABLE} -c "import lbmpy" RESULT_VARIABLE LBMPY_FOUND ) if(NOT LBMPY_FOUND EQUAL 0) @@ -608,9 +615,6 @@ endif() ## ############################################################################################################################# if ( WALBERLA_BUILD_WITH_PYTHON ) - set( Python_FIND_FRAMEWORK LAST ) - find_package( Python COMPONENTS Interpreter Development REQUIRED) - if(WALBERLA_CXX_COMPILER_IS_INTEL) # Intel C++17 support introduced in 2.6.2 (https://github.com/pybind/pybind11/pull/2729) set(PYBIND11_MINIMUM_VERSION "2.6.2") -- GitLab