From f84fcdfda6bcace5e1bdb668c57afccd08b814d1 Mon Sep 17 00:00:00 2001 From: Massimiliano Galli <massimiliano.galli@cern.ch> Date: Wed, 1 Apr 2020 13:13:23 +0200 Subject: [PATCH] [CMake] Add quotes to avoid failure on Windows node Quotes are necessary in case the Python2_VERSION variable is not defined, to prevent a missing operand in the expression that compares the version. --- cmake/modules/SearchRootCoreDeps.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/modules/SearchRootCoreDeps.cmake b/cmake/modules/SearchRootCoreDeps.cmake index e032dc13287..d9c47f736f4 100644 --- a/cmake/modules/SearchRootCoreDeps.cmake +++ b/cmake/modules/SearchRootCoreDeps.cmake @@ -49,7 +49,7 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.14) if(DEFINED Python2_VERSION AND "${Python2_VERSION}" VERSION_LESS "2.7") message(WARNING "Ignoring Python2 installation: unsupported version ${Python2_VERSION} (version>=2.7 required)") endif() - if(Python2_Development_FOUND AND ${Python2_VERSION} VERSION_GREATER_EQUAL "2.7") + if(Python2_Development_FOUND AND "${Python2_VERSION}" VERSION_GREATER_EQUAL "2.7") if(NOT Python3_Development_FOUND) # Only Python2 was found, set as main set(PYTHON_EXECUTABLE "${Python2_EXECUTABLE}" CACHE INTERNAL "" FORCE) @@ -75,7 +75,7 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.14) endif() endif() - if(NOT Python3_Development_FOUND AND (NOT Python2_Development_FOUND OR ${Python2_VERSION} VERSION_LESS "2.7")) + if(NOT Python3_Development_FOUND AND (NOT Python2_Development_FOUND OR "${Python2_VERSION}" VERSION_LESS "2.7")) message(FATAL_ERROR "No supported Python 2 or 3 were found") endif() -- GitLab