meson: move generation of cmake config file to cmake option flag
authorsubhransu mohanty <sub.mohanty@samsung.com>
Fri, 19 Jul 2019 06:24:06 +0000 (15:24 +0900)
committerHermet Park <hermetpark@gmail.com>
Tue, 23 Jul 2019 04:45:02 +0000 (13:45 +0900)
Change-Id: I3217fbec58d46dfdb20fa78d16ce5003776f8cb6

meson.build
meson_options.txt

index d61732e..e4d1669 100644 (file)
@@ -51,27 +51,26 @@ if get_option('test') == true
    subdir('test')
 endif
 
-#FIXME: Temporarily comment out this code
-#       this code needed cmake version check
-#if host_machine.system() != 'windows'
-#    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
-#endif
+
+if get_option('cmake') == true and host_machine.system() != 'windows'
+    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
+endif
 
 summary = '''
 
index cada55c..bf4a854 100644 (file)
@@ -33,8 +33,10 @@ option('example',
    value: true,
    description: 'Enable building examples')
 
-option('text',
-   type: 'boolean',
-   value: false,
-   description: 'Enable text module')
+option('cmake',
+  type: 'boolean',
+  value: false,
+  description: 'Enable Generating  CMake config files')
+
+