aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaud Rebillout <arnaud.rebillout@collabora.com>2018-11-26 17:29:28 +0700
committerArun Raghavan <arun@arunraghavan.net>2019-06-08 12:03:03 +0200
commit538229633f46d970e77e4b28db563da38f18a7cc (patch)
tree2c05aa5c82bb61ffa8bb810cbfbf672b634ceb82
parenta054e088a3675090738511992b66db25044f442c (diff)
downloadpulseaudio-538229633f46d970e77e4b28db563da38f18a7cc.tar.gz
meson: Install cmake files
Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
-rw-r--r--meson.build37
1 files changed, 37 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 09c17fed..7e204c58 100644
--- a/meson.build
+++ b/meson.build
@@ -445,6 +445,13 @@ if webrtc_dep.found()
cdata.set('HAVE_WEBRTC', 1)
endif
+# These are required for the CMake file generation
+cdata.set('PA_LIBDIR', libdir)
+cdata.set('PA_INCDIR', includedir)
+if glib_dep.found()
+ cdata.set('HAVE_GLIB20', 1) # to match the AM_CONDITIONAL for CMake file generation
+endif
+
# Test dependencies
check_dep = dependency('check', version : '>= 0.9.10', required : get_option('tests'))
@@ -486,6 +493,36 @@ foreach file : pc_files
install_dir : pkgconfigdir)
endforeach
+# CMake files
+
+m4 = find_program('m4', required: true)
+
+cmakedir = join_paths(libdir, 'cmake', 'PulseAudio')
+
+cmake_template_file = configure_file(
+ input : 'PulseAudioConfig.cmake.in',
+ output : 'PulseAudioConfig.cmake.tmp',
+ configuration: cdata,
+)
+
+custom_target('PulseAudioConfig.cmake',
+ input : cmake_template_file,
+ output : 'PulseAudioConfig.cmake',
+ capture : true,
+ command : [m4, '@INPUT@'],
+ build_by_default : true,
+ install : true,
+ install_dir : cmakedir,
+)
+
+configure_file(
+ input : 'PulseAudioConfigVersion.cmake.in',
+ output : 'PulseAudioConfigVersion.cmake',
+ configuration: cdata,
+ install : true,
+ install_dir : cmakedir,
+)
+
# Subdirs
subdir('po')