Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Implementation of cmake policy error for python #3055

Closed
wants to merge 8 commits into from
7 changes: 6 additions & 1 deletion easybuild/easyblocks/c/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.config import build_option
from easybuild.tools.filetools import apply_regex_substitutions
from easybuild.tools.modules import get_software_root, get_software_libdir
from easybuild.tools.modules import get_software_root, get_software_libdir, get_software_version
import easybuild.tools.environment as env
from easybuild.tools.filetools import symlink
from easybuild.tools import LooseVersion


class EB_CMake(ConfigureMake):
Expand Down Expand Up @@ -99,6 +100,10 @@ def configure_step(self):
add_cmake_opts = {}
if self.cfg['use_openssl']:
add_cmake_opts['CMAKE_USE_OPENSSL'] = 'ON'
# Use CMP0094 policy for python resolution. This is only available for CMake versions newer than 3.15 included
cmake_version = get_software_version('CMake')
if LooseVersion(cmake_version) >= LooseVersion('3.15'):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this more readable:

Suggested change
if LooseVersion(cmake_version) >= LooseVersion('3.15'):
if LooseVersion(cmake_version) >= '3.15':

But just a suggestion

add_cmake_opts['MAKE_POLICY_DEFAULT_CMP0094'] = 'NEW'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
add_cmake_opts['MAKE_POLICY_DEFAULT_CMP0094'] = 'NEW'
add_cmake_opts['CMAKE_POLICY_DEFAULT_CMP0094'] = 'NEW'

https://cmake.org/cmake/help/latest/variable/CMAKE_POLICY_DEFAULT_CMPNNNN.html


cmake_prefix_path = os.environ.get('CMAKE_PREFIX_PATH', '').split(':')
cmake_library_path = os.environ.get('CMAKE_LIBRARY_PATH', '').split(':')
Expand Down