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'