diff options
Diffstat (limited to 'mesonbuild/modules/cmake.py')
-rw-r--r-- | mesonbuild/modules/cmake.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/mesonbuild/modules/cmake.py b/mesonbuild/modules/cmake.py index 67fdd0c..0f325f5 100644 --- a/mesonbuild/modules/cmake.py +++ b/mesonbuild/modules/cmake.py @@ -20,7 +20,7 @@ from . import ExtensionModule, ModuleReturnValue, ModuleObject from .. import build, mesonlib, mlog, dependencies from ..cmake import SingleTargetOptions, TargetOptions, cmake_defines_to_args -from ..interpreter import ConfigurationDataObject, SubprojectHolder +from ..interpreter import SubprojectHolder from ..interpreterbase import ( FeatureNew, FeatureNewKwargs, @@ -34,7 +34,6 @@ from ..interpreterbase import ( InvalidArguments, InterpreterException, ) -from ..programs import ExternalProgram COMPATIBILITIES = ['AnyNewerVersion', 'SameMajorVersion', 'SameMinorVersion', 'ExactVersion'] @@ -213,6 +212,7 @@ class CmakeModule(ExtensionModule): cmake_detected = False cmake_root = None + @FeatureNew('CMake Module', '0.50.0') def __init__(self, interpreter): super().__init__(interpreter) self.methods.update({ @@ -233,11 +233,11 @@ class CmakeModule(ExtensionModule): return compiler.sizeof('void *', '', env) - def detect_cmake(self): + def detect_cmake(self, state): if self.cmake_detected: return True - cmakebin = ExternalProgram('cmake', silent=False) + cmakebin = state.find_program('cmake', silent=False) if not cmakebin.found(): return False @@ -272,7 +272,7 @@ class CmakeModule(ExtensionModule): if compatibility not in COMPATIBILITIES: raise mesonlib.MesonException('compatibility must be either AnyNewerVersion, SameMajorVersion or ExactVersion.') - if not self.detect_cmake(): + if not self.detect_cmake(state): raise mesonlib.MesonException('Unable to find cmake') pkgroot = pkgroot_name = kwargs.get('install_dir', None) @@ -358,7 +358,7 @@ class CmakeModule(ExtensionModule): if 'configuration' not in kwargs: raise mesonlib.MesonException('"configuration" not specified.') conf = kwargs['configuration'] - if not isinstance(conf, ConfigurationDataObject): + if not isinstance(conf, build.ConfigurationData): raise mesonlib.MesonException('Argument "configuration" is not of type configuration_data') prefix = state.environment.coredata.get_option(mesonlib.OptionKey('prefix')) @@ -372,8 +372,8 @@ class CmakeModule(ExtensionModule): extra = PACKAGE_INIT_EXT.replace('@absInstallDir@', abs_install_dir) extra = extra.replace('@installPrefix@', prefix) - self.create_package_file(ifile_abs, ofile_abs, PACKAGE_RELATIVE_PATH, extra, conf.conf_data) - conf.mark_used() + self.create_package_file(ifile_abs, ofile_abs, PACKAGE_RELATIVE_PATH, extra, conf) + conf.used = True conffile = os.path.normpath(inputfile.relative_name()) if conffile not in self.interpreter.build_def_files: |