improve README
[platform/core/uifw/lottie-player.git] / meson.build
1 project('rlottie',
2         'cpp',
3         default_options : ['warning_level=3', 'werror=true', 'cpp_std=c++14', 'optimization=s'],
4         version : '0.1',
5         license : 'MIT',
6         meson_version : '>=0.49',
7         )
8
9 add_project_arguments('-DDEMO_DIR="@0@/example/resource/"'.format(meson.current_source_dir()), language : 'cpp')
10
11 inc = [include_directories('inc')]
12 config_dir = include_directories('.')
13 inc += config_dir
14
15 config_h = configuration_data()
16
17 if get_option('thread') == true
18     config_h.set10('LOTTIE_THREAD_SUPPORT', true)
19 endif
20
21 if get_option('module') == true
22     config_h.set10('LOTTIE_IMAGE_MODULE_SUPPORT', true)
23
24     if meson.get_compiler('cpp').get_id() != 'msvc'
25       lib_prefix = 'lib'
26     else
27       lib_prefix = ''
28     endif
29     if host_machine.system() == 'darwin'
30       lib_suffix = '.dylib'
31     elif host_machine.system() == 'windows'
32       lib_suffix = '.dll'
33     else
34       lib_suffix = '.so'
35     endif
36     if get_option('moduledir') != ''
37       config_h.set_quoted('LOTTIE_IMAGE_MODULE_PLUGIN',
38         get_option('prefix') / get_option('moduledir') / lib_prefix + 'rlottie-image-loader' + lib_suffix)
39     else
40       config_h.set_quoted('LOTTIE_IMAGE_MODULE_PLUGIN', lib_prefix + 'rlottie-image-loader' + lib_suffix)
41     endif
42 endif
43
44 if get_option('cache') == true
45     config_h.set10('LOTTIE_CACHE_SUPPORT', true)
46 endif
47
48 if get_option('log') == true
49     config_h.set10('LOTTIE_LOGGING_SUPPORT', true)
50 endif
51
52 if get_option('dumptree') == true
53     config_h.set10('LOTTIE_LOGGING_SUPPORT', true)
54     config_h.set10('LOTTIE_DUMP_TREE_SUPPORT', true)
55 endif
56
57
58 configure_file(
59   output: 'config.h',
60   configuration: config_h
61 )
62
63
64 subdir('inc')
65 subdir('src')
66
67 if get_option('example') == true
68     subdir('example')
69 endif
70
71 if get_option('test') == true
72    subdir('test')
73 endif
74
75
76 if get_option('cmake') == true and host_machine.system() != 'windows'
77     cmake_bin = find_program('cmake', required: false)
78     if cmake_bin.found()
79         cmake = import('cmake')
80         cmake.write_basic_package_version_file(
81             version: meson.project_version(),
82             name: 'rlottie',
83         )
84
85         cmakeconf = configuration_data()
86         cmakeconf.set('VERSION', meson.project_version())
87
88         cmake.configure_package_config_file(
89             input: meson.current_source_dir() + '/cmake/rlottieConfig.cmake.in',
90             name: 'rlottie',
91             configuration: cmakeconf,
92         )
93     endif
94 endif
95
96 summary = '''
97
98 Summary:
99     rlottie version :        @0@
100     Build type      :        @1@
101     Thread Support  :        @2@
102     Module Support  :        @3@
103     Cache  Support  :        @4@
104     Example         :        @5@
105     Test            :        @6@
106     Prefix          :        @7@
107 '''.format(
108         meson.project_version(),
109         get_option('buildtype'),
110         get_option('thread'),
111         get_option('module'),
112         get_option('cache'),
113         get_option('example'),
114         get_option('test'),
115         get_option('prefix'),
116     )
117
118 message(summary)
119
120
121