From 5a460794d65fb79c675a06d18d59167a0e370a20 Mon Sep 17 00:00:00 2001 From: Caspar van Leeuwen Date: Tue, 23 Jan 2024 23:40:24 +0100 Subject: [PATCH] Set policy so that the python is selected based on location, i.e. the order in PATH, rather than the newest version (which might be an OS python). --- easybuild/easyblocks/generic/cmakemake.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/easybuild/easyblocks/generic/cmakemake.py b/easybuild/easyblocks/generic/cmakemake.py index 0a326a8e5a..3074193df0 100644 --- a/easybuild/easyblocks/generic/cmakemake.py +++ b/easybuild/easyblocks/generic/cmakemake.py @@ -273,6 +273,11 @@ def configure_step(self, srcdir=None, builddir=None): # see https://github.com/Kitware/CMake/commit/3ec9226779776811240bde88a3f173c29aa935b5 options['CMAKE_SKIP_RPATH'] = 'ON' + # make sure that newer CMAKE picks python based on location, not just the newest python + # Avoids issues like e.g. https://github.com/EESSI/software-layer/pull/370#issuecomment-1785594932 + if LooseVersion(self.cmake_version) >= '3.15': + options['CMAKE_POLICY_DEFAULT_CMP0094'] = 'NEW' + # show what CMake is doing by default options['CMAKE_VERBOSE_MAKEFILE'] = 'ON'