From 6dc33dcd70379d2205a0a4f1ba47ca1d54808b4d Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 14 Apr 2021 16:45:42 +0200 Subject: [PATCH] Corrected error in python detection --- CDMATH/tests/CMakeLists.txt | 2 +- CMakeLists.txt | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CDMATH/tests/CMakeLists.txt b/CDMATH/tests/CMakeLists.txt index 2dd988d..8a98ca6 100755 --- a/CDMATH/tests/CMakeLists.txt +++ b/CDMATH/tests/CMakeLists.txt @@ -61,7 +61,7 @@ if (CDMATH_WITH_PYTHON AND CDMATH_WITH_PETSC AND CDMATH_WITH_POSTPRO) add_subdirectory (${examples_dir}) add_subdirectory (validation) - add_custom_target (tests_CDMATH COMMAND ctest -O tests.log) + add_custom_target (tests_CDMATH COMMAND ctest -O testsCDMATH.log) add_custom_target (check COMMAND ctest -E 'validation|Example')# may be replace ctest -E with ctest -LE add_custom_target (examples COMMAND ctest -R Example)# may be replace ctest -R with ctest -L add_custom_target (validation COMMAND ctest -R validation)# may be replace ctest -R with ctest -L diff --git a/CMakeLists.txt b/CMakeLists.txt index 5859efb..8b9c6da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -463,13 +463,13 @@ ELSE ( ${PARAVIEW_VERSION} STRGREATER "5.6" OR ${PARAVIEW_VERSION} STREQUAL "5.6 ENDIF( ${PARAVIEW_VERSION} STRGREATER "5.6" OR ${PARAVIEW_VERSION} STREQUAL "5.6" ) # Find python -IF ( PYTHON_ROOT_DIR OR ENV{PYTHON_ROOT_DIR}) - IF ( PYTHON_ROOT_DIR ) +IF ( DEFINED PYTHON_ROOT_DIR OR DEFINED ENV{PYTHON_ROOT_DIR}) + IF ( DEFINED PYTHON_ROOT_DIR ) set(Python_ROOT_DIR ${PYTHON_ROOT_DIR} ) - ELSE( PYTHON_ROOT_DIR ) + ELSE( DEFINED PYTHON_ROOT_DIR ) set(Python_ROOT_DIR $ENV{PYTHON_ROOT_DIR} ) - ENDIF( PYTHON_ROOT_DIR) -ENDIF(PYTHON_ROOT_DIR OR ENV{PYTHON_ROOT_DIR}) + ENDIF( DEFINED PYTHON_ROOT_DIR) +ENDIF(DEFINED PYTHON_ROOT_DIR OR DEFINED ENV{PYTHON_ROOT_DIR}) IF (${CMAKE_VERSION} VERSION_GREATER "3.12.0") find_package(Python ${PYTHON2OR3} REQUIRED COMPONENTS Interpreter Development ) -- 2.39.2