aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/modules/cmake.py3
-rw-r--r--test cases/cmake/19 cmake file/foolib.cmake.in1
-rw-r--r--test cases/cmake/19 cmake file/meson.build14
-rw-r--r--test cases/cmake/19 cmake file/test.json5
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"}
+ ]
+}