meson: fix issue when cmake is not installed
authorsubhransu mohanty <sub.mohanty@samsung.com>
Thu, 11 Jul 2019 03:24:00 +0000 (12:24 +0900)
committerJunsuChoi <jsuya.choi@samsung.com>
Thu, 18 Jul 2019 11:04:28 +0000 (20:04 +0900)
meson.build

index 7bab4a3602e33fee612d142ab0c392dc4c0908fe..d4696d81ad1cf0f94ad6fe02b136d1ad309eb670 100644 (file)
@@ -53,21 +53,23 @@ if get_option('test') == true
 endif
 
 
-
-cmake = import('cmake')
-cmake.write_basic_package_version_file(
-    version: meson.project_version(),
-    name: 'rlottie',
-)
-
-cmakeconf = configuration_data()
-cmakeconf.set('VERSION', meson.project_version())
-
-cmake.configure_package_config_file(
-    input: meson.current_source_dir() + '/cmake/rlottieConfig.cmake.in',
-    name: 'rlottie',
-    configuration: cmakeconf,
-)
+cmake_bin = find_program('cmake', required: false)
+if cmake_bin.found()
+    cmake = import('cmake')
+    cmake.write_basic_package_version_file(
+        version: meson.project_version(),
+        name: 'rlottie',
+    )
+
+    cmakeconf = configuration_data()
+    cmakeconf.set('VERSION', meson.project_version())
+
+    cmake.configure_package_config_file(
+        input: meson.current_source_dir() + '/cmake/rlottieConfig.cmake.in',
+        name: 'rlottie',
+        configuration: cmakeconf,
+    )
+endif