diff --git a/easybuild/easyblocks/generic/cmakemake.py b/easybuild/easyblocks/generic/cmakemake.py index 906fa5ade2..cfdb73f02d 100644 --- a/easybuild/easyblocks/generic/cmakemake.py +++ b/easybuild/easyblocks/generic/cmakemake.py @@ -289,10 +289,10 @@ def configure_step(self, srcdir=None, builddir=None): if python_root: python_version = LooseVersion(get_software_version('Python')) python_exe = os.path.join(python_root, 'bin', 'python') - options['Python_EXECUTABLE'] = python_exe - # This is needed if someone is still using `find_package(PythonInterp ...)` in their CMakeLists.txt + # This is required for (deprecated) `find_package(PythonInterp ...)` options['PYTHON_EXECUTABLE'] = python_exe # Ensure that both `find_package(Python) and find_package(Python2/3)` work as intended + options['Python_EXECUTABLE'] = python_exe if python_version >= "3": options['Python3_EXECUTABLE'] = python_exe else: