diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-06-11 10:30:53 -0700 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2020-06-12 15:51:21 +0000 |
commit | 49a974213c998937bcefe43622bb24d84666c4f2 (patch) | |
tree | a899daf9437b95e259f0179127dc8143883e916a | |
parent | 0332d7e35006afa78afb5e4b4f4d2ecf9a7ded27 (diff) | |
download | meson-49a974213c998937bcefe43622bb24d84666c4f2.zip meson-49a974213c998937bcefe43622bb24d84666c4f2.tar.gz meson-49a974213c998937bcefe43622bb24d84666c4f2.tar.bz2 |
modules/cmake: Fix setting install_dir
Fixes: #7301
-rw-r--r-- | mesonbuild/modules/cmake.py | 3 | ||||
-rw-r--r-- | test cases/cmake/19 cmake file/foolib.cmake.in | 1 | ||||
-rw-r--r-- | test cases/cmake/19 cmake file/meson.build | 14 | ||||
-rw-r--r-- | test cases/cmake/19 cmake file/test.json | 5 |
4 files changed, 21 insertions, 2 deletions
diff --git a/mesonbuild/modules/cmake.py b/mesonbuild/modules/cmake.py index 6c4098b..6d91b99 100644 --- a/mesonbuild/modules/cmake.py +++ b/mesonbuild/modules/cmake.py @@ -252,8 +252,7 @@ class CmakeModule(ExtensionModule): (ofile_path, ofile_fname) = os.path.split(os.path.join(state.subdir, '{}Config.cmake'.format(name))) ofile_abs = os.path.join(state.environment.build_dir, ofile_path, ofile_fname) - if 'install_dir' not in kwargs: - install_dir = os.path.join(state.environment.coredata.get_builtin_option('libdir'), 'cmake', name) + install_dir = kwargs.get('install_dir', os.path.join(state.environment.coredata.get_builtin_option('libdir'), 'cmake', name)) if not isinstance(install_dir, str): raise mesonlib.MesonException('"install_dir" must be a string.') diff --git a/test cases/cmake/19 cmake file/foolib.cmake.in b/test cases/cmake/19 cmake file/foolib.cmake.in new file mode 100644 index 0000000..16e992b --- /dev/null +++ b/test cases/cmake/19 cmake file/foolib.cmake.in @@ -0,0 +1 @@ +@foo@ diff --git a/test cases/cmake/19 cmake file/meson.build b/test cases/cmake/19 cmake file/meson.build new file mode 100644 index 0000000..758bbee --- /dev/null +++ b/test cases/cmake/19 cmake file/meson.build @@ -0,0 +1,14 @@ +project( + 'cmake config file', +) + +cmake = import('cmake') + +cmake_conf = configuration_data() +cmake_conf.set_quoted('foo', 'bar') +cmake.configure_package_config_file( + name : 'foolib', + input : 'foolib.cmake.in', + install_dir : get_option('libdir') / 'cmake', + configuration : cmake_conf, +) diff --git a/test cases/cmake/19 cmake file/test.json b/test cases/cmake/19 cmake file/test.json new file mode 100644 index 0000000..a8c4ba3 --- /dev/null +++ b/test cases/cmake/19 cmake file/test.json @@ -0,0 +1,5 @@ +{ + "installed": [ + {"file": "usr/lib/cmake/foolibConfig.cmake", "type": "file"} + ] +} |