Cleanup: missing 'initialize' -> 'init' from previous cleanup
[blender.git] / source / blender / blenlib / CMakeLists.txt
1 # ***** BEGIN GPL LICENSE BLOCK *****
2 #
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 #
17 # The Original Code is Copyright (C) 2006, Blender Foundation
18 # All rights reserved.
19 # ***** END GPL LICENSE BLOCK *****
20
21 set(INC
22   .
23   # ../blenkernel  # dont add this back!
24   ../makesdna
25   ../../../intern/atomic
26   ../../../intern/eigen
27   ../../../intern/guardedalloc
28   ../../../intern/numaapi/include
29   ../../../extern/wcwidth
30 )
31
32 set(INC_SYS
33   ${ZLIB_INCLUDE_DIRS}
34   ${FREETYPE_INCLUDE_DIRS}
35 )
36
37 set(SRC
38   intern/BLI_args.c
39   intern/BLI_array.c
40   intern/BLI_dial_2d.c
41   intern/BLI_dynstr.c
42   intern/BLI_filelist.c
43   intern/BLI_ghash.c
44   intern/BLI_ghash_utils.c
45   intern/BLI_heap.c
46   intern/BLI_heap_simple.c
47   intern/BLI_index_range.cc
48   intern/BLI_kdopbvh.c
49   intern/BLI_linklist.c
50   intern/BLI_linklist_lockfree.c
51   intern/BLI_memarena.c
52   intern/BLI_memblock.c
53   intern/BLI_memiter.c
54   intern/BLI_mempool.c
55   intern/BLI_timer.c
56   intern/DLRB_tree.c
57   intern/array_store.c
58   intern/array_store_utils.c
59   intern/array_utils.c
60   intern/astar.c
61   intern/bitmap.c
62   intern/bitmap_draw_2d.c
63   intern/boxpack_2d.c
64   intern/buffer.c
65   intern/convexhull_2d.c
66   intern/delaunay_2d.c
67   intern/dot_export.cc
68   intern/dynlib.c
69   intern/easing.c
70   intern/edgehash.c
71   intern/endian_switch.c
72   intern/expr_pylike_eval.c
73   intern/fileops.c
74   intern/fnmatch.c
75   intern/freetypefont.c
76   intern/gsqueue.c
77   intern/hash_md5.c
78   intern/hash_mm2a.c
79   intern/hash_mm3.c
80   intern/jitter_2d.c
81   intern/kdtree_1d.c
82   intern/kdtree_2d.c
83   intern/kdtree_3d.c
84   intern/kdtree_4d.c
85   intern/lasso_2d.c
86   intern/listbase.c
87   intern/math_base.c
88   intern/math_base_inline.c
89   intern/math_base_safe_inline.c
90   intern/math_bits_inline.c
91   intern/math_color.c
92   intern/math_color_blend_inline.c
93   intern/math_color_inline.c
94   intern/math_geom.c
95   intern/math_geom_inline.c
96   intern/math_interp.c
97   intern/math_matrix.c
98   intern/math_rotation.c
99   intern/math_solvers.c
100   intern/math_statistics.c
101   intern/math_vector.c
102   intern/math_vector_inline.c
103   intern/memory_utils.c
104   intern/noise.c
105   intern/path_util.c
106   intern/polyfill_2d.c
107   intern/polyfill_2d_beautify.c
108   intern/quadric.c
109   intern/rand.cc
110   intern/rct.c
111   intern/scanfill.c
112   intern/scanfill_utils.c
113   intern/session_uuid.c
114   intern/smallhash.c
115   intern/sort.c
116   intern/sort_utils.c
117   intern/stack.c
118   intern/storage.c
119   intern/string.c
120   intern/string_cursor_utf8.c
121   intern/string_utf8.c
122   intern/string_utils.c
123   intern/system.c
124   intern/task_graph.cc
125   intern/task_iterator.c
126   intern/task_pool.cc
127   intern/task_range.cc
128   intern/task_scheduler.cc
129   intern/threads.cc
130   intern/time.c
131   intern/timecode.c
132   intern/timeit.cc
133   intern/uvproject.c
134   intern/voronoi_2d.c
135   intern/voxel.c
136   intern/winstuff.c
137   intern/winstuff_dir.c
138
139   # Header as source (included in C files above).
140   intern/kdtree_impl.h
141   intern/list_sort_impl.h
142
143
144   BLI_alloca.h
145   BLI_allocator.hh
146   BLI_args.h
147   BLI_array.h
148   BLI_array.hh
149   BLI_array_store.h
150   BLI_array_store_utils.h
151   BLI_array_utils.h
152   BLI_asan.h
153   BLI_assert.h
154   BLI_astar.h
155   BLI_bitmap.h
156   BLI_bitmap_draw_2d.h
157   BLI_blenlib.h
158   BLI_boxpack_2d.h
159   BLI_buffer.h
160   BLI_color.hh
161   BLI_compiler_attrs.h
162   BLI_compiler_compat.h
163   BLI_compiler_typecheck.h
164   BLI_console.h
165   BLI_convexhull_2d.h
166   BLI_delaunay_2d.h
167   BLI_dial_2d.h
168   BLI_disjoint_set.hh
169   BLI_dlrbTree.h
170   BLI_dot_export.hh
171   BLI_dot_export_attribute_enums.hh
172   BLI_dynlib.h
173   BLI_dynstr.h
174   BLI_easing.h
175   BLI_edgehash.h
176   BLI_endian_switch.h
177   BLI_endian_switch_inline.h
178   BLI_expr_pylike_eval.h
179   BLI_fileops.h
180   BLI_fileops_types.h
181   BLI_float2.hh
182   BLI_float3.hh
183   BLI_float4x4.hh
184   BLI_fnmatch.h
185   BLI_ghash.h
186   BLI_gsqueue.h
187   BLI_hash.h
188   BLI_hash.hh
189   BLI_hash_md5.h
190   BLI_hash_mm2a.h
191   BLI_hash_mm3.h
192   BLI_hash_tables.hh
193   BLI_heap.h
194   BLI_heap_simple.h
195   BLI_index_mask.hh
196   BLI_index_range.hh
197   BLI_iterator.h
198   BLI_jitter_2d.h
199   BLI_kdopbvh.h
200   BLI_kdtree.h
201   BLI_kdtree_impl.h
202   BLI_lasso_2d.h
203   BLI_linear_allocator.hh
204   BLI_link_utils.h
205   BLI_linklist.h
206   BLI_linklist_lockfree.h
207   BLI_linklist_stack.h
208   BLI_listbase.h
209   BLI_listbase_wrapper.hh
210   BLI_map.hh
211   BLI_map_slots.hh
212   BLI_math.h
213   BLI_math_base.h
214   BLI_math_base_safe.h
215   BLI_math_bits.h
216   BLI_math_color.h
217   BLI_math_color_blend.h
218   BLI_math_geom.h
219   BLI_math_inline.h
220   BLI_math_interp.h
221   BLI_math_matrix.h
222   BLI_math_rotation.h
223   BLI_math_solvers.h
224   BLI_math_statistics.h
225   BLI_math_vector.h
226   BLI_memarena.h
227   BLI_memblock.h
228   BLI_memiter.h
229   BLI_memory_utils.h
230   BLI_memory_utils.hh
231   BLI_mempool.h
232   BLI_noise.h
233   BLI_path_util.h
234   BLI_polyfill_2d.h
235   BLI_polyfill_2d_beautify.h
236   BLI_probing_strategies.hh
237   BLI_quadric.h
238   BLI_rand.h
239   BLI_rand.hh
240   BLI_rect.h
241   BLI_resource_collector.hh
242   BLI_scanfill.h
243   BLI_session_uuid.h
244   BLI_set.hh
245   BLI_set_slots.hh
246   BLI_smallhash.h
247   BLI_sort.h
248   BLI_sort_utils.h
249   BLI_span.hh
250   BLI_stack.h
251   BLI_stack.hh
252   BLI_strict_flags.h
253   BLI_string.h
254   BLI_string_cursor_utf8.h
255   BLI_string_ref.hh
256   BLI_string_utf8.h
257   BLI_string_utils.h
258   BLI_sys_types.h
259   BLI_system.h
260   BLI_task.h
261   BLI_threads.h
262   BLI_timecode.h
263   BLI_timeit.hh
264   BLI_timer.h
265   BLI_utildefines.h
266   BLI_utildefines_iter.h
267   BLI_utildefines_stack.h
268   BLI_utildefines_variadic.h
269   BLI_utility_mixins.hh
270   BLI_uvproject.h
271   BLI_vector.hh
272   BLI_vector_adaptor.hh
273   BLI_vector_set.hh
274   BLI_vector_set_slots.hh
275   BLI_vfontdata.h
276   BLI_voronoi_2d.h
277   BLI_voxel.h
278   BLI_winstuff.h
279   PIL_time.h
280   PIL_time_utildefines.h
281 )
282
283 set(LIB
284   bf_intern_eigen
285   bf_intern_guardedalloc
286   bf_intern_numaapi
287   extern_wcwidth
288
289   ${FREETYPE_LIBRARY}
290 )
291
292 if(WITH_MEM_VALGRIND)
293   add_definitions(-DWITH_MEM_VALGRIND)
294 endif()
295
296 if(WITH_TBB)
297   add_definitions(-DWITH_TBB)
298
299   list(APPEND INC_SYS
300     ${TBB_INCLUDE_DIRS}
301   )
302
303   list(APPEND LIB
304     ${TBB_LIBRARIES}
305   )
306 endif()
307
308 if(WIN32)
309   list(APPEND INC
310     ../../../intern/utfconv
311   )
312   list(APPEND LIB
313     bf_intern_utfconv
314   )
315   list(APPEND SRC
316     intern/system_win32.c
317   )
318 endif()
319
320
321 if(APPLE)
322   list(APPEND SRC
323     intern/storage_apple.mm
324   )
325 endif()
326
327 if(UNIX AND NOT APPLE)
328   list(APPEND LIB
329     bf_intern_libc_compat
330   )
331 endif()
332
333 # no need to compile object files for inline headers.
334 set_source_files_properties(
335   intern/math_base_inline.c
336   intern/math_base_safe_inline.c
337   intern/math_bits_inline.c
338   intern/math_color_blend_inline.c
339   intern/math_color_inline.c
340   intern/math_geom_inline.c
341   intern/math_vector_inline.c
342   PROPERTIES HEADER_FILE_ONLY TRUE
343 )
344
345 blender_add_lib(bf_blenlib "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
346
347 if(WITH_GTESTS)
348   set(TEST_SRC
349     tests/BLI_array_test.cc
350     tests/BLI_disjoint_set_test.cc
351     tests/BLI_edgehash_test.cc
352     tests/BLI_index_mask_test.cc
353     tests/BLI_index_range_test.cc
354     tests/BLI_linear_allocator_test.cc
355     tests/BLI_map_test.cc
356     tests/BLI_math_base_safe_test.cc
357     tests/BLI_memory_utils_test.cc
358     tests/BLI_multi_value_map_test.cc
359     tests/BLI_set_test.cc
360     tests/BLI_span_test.cc
361     tests/BLI_stack_cxx_test.cc
362     tests/BLI_string_ref_test.cc
363     tests/BLI_vector_set_test.cc
364     tests/BLI_vector_test.cc
365   )
366   set(TEST_LIB
367     bf_blenlib
368   )
369   include(GTestTesting)
370   blender_add_test_lib(bf_bli_tests "${TEST_SRC}" "${INC};${TEST_INC}" "${INC_SYS}" "${LIB};${TEST_LIB}")
371 endif()