Cleanup: Subdiv: Remove common_ prefix
[blender.git] / source / blender / blenlib / CMakeLists.txt
blob9818370652c249eaff53a129c370b2d404ed61e7
1 # SPDX-FileCopyrightText: 2006 Blender Authors
3 # SPDX-License-Identifier: GPL-2.0-or-later
5 if(HAVE_EXECINFO_H)
6   add_definitions(-DHAVE_EXECINFO_H)
7 endif()
9 set(INC
10   PUBLIC .
11   ../../../intern/eigen
14 set(INC_SYS
15   ../../../extern/wcwidth
16   ../../../extern/json/include
18   ${EIGEN3_INCLUDE_DIRS}
19   ${ZLIB_INCLUDE_DIRS}
20   ${ZSTD_INCLUDE_DIRS}
23 set(SRC
24   intern/BLI_assert.c
25   intern/BLI_color.cc
26   intern/BLI_dial_2d.c
27   intern/BLI_dynstr.c
28   intern/BLI_filelist.cc
29   intern/BLI_ghash.c
30   intern/BLI_ghash_utils.cc
31   intern/BLI_heap.c
32   intern/BLI_heap_simple.c
33   intern/BLI_kdopbvh.cc
34   intern/BLI_linklist.c
35   intern/BLI_linklist_lockfree.c
36   intern/BLI_memarena.c
37   intern/BLI_memblock.c
38   intern/BLI_memiter.c
39   intern/BLI_mempool.c
40   intern/BLI_mmap.c
41   intern/BLI_subprocess.cc
42   intern/BLI_timer.c
43   intern/array_store.cc
44   intern/array_store_utils.cc
45   intern/array_utils.c
46   intern/array_utils.cc
47   intern/astar.c
48   intern/atomic_disjoint_set.cc
49   intern/bit_bool_conversion.cc
50   intern/bit_ref.cc
51   intern/bit_span.cc
52   intern/bitmap.c
53   intern/bitmap_draw_2d.cc
54   intern/boxpack_2d.c
55   intern/buffer.c
56   intern/cache_mutex.cc
57   intern/compute_context.cc
58   intern/convexhull_2d.cc
59   intern/cpp_type.cc
60   intern/cpp_types.cc
61   intern/delaunay_2d.cc
62   intern/dot_export.cc
63   intern/easing.c
64   intern/endian_switch.c
65   intern/expr_pylike_eval.c
66   intern/fftw.cc
67   intern/fileops.cc
68   intern/fileops_c.cc
69   intern/filereader_file.c
70   intern/filereader_gzip.c
71   intern/filereader_memory.c
72   intern/filereader_zstd.c
73   intern/fnmatch.c
74   intern/generic_vector_array.cc
75   intern/generic_virtual_array.cc
76   intern/generic_virtual_vector_array.cc
77   intern/gsqueue.c
78   intern/hash_md5.cc
79   intern/hash_mm2a.cc
80   intern/hash_mm3.cc
81   intern/hash_tables.cc
82   intern/implicit_sharing.cc
83   intern/index_mask.cc
84   intern/index_mask_expression.cc
85   intern/index_range.cc
86   intern/jitter_2d.c
87   intern/kdtree_1d.c
88   intern/kdtree_2d.c
89   intern/kdtree_3d.c
90   intern/kdtree_4d.c
91   intern/lasso_2d.cc
92   intern/lazy_threading.cc
93   intern/length_parameterize.cc
94   intern/listbase.cc
95   intern/math_base.cc
96   intern/math_base_inline.c
97   intern/math_base_safe_inline.c
98   intern/math_basis_types.cc
99   intern/math_bits_inline.c
100   intern/math_boolean.cc
101   intern/math_color.cc
102   intern/math_color_blend_inline.c
103   intern/math_color_inline.c
104   intern/math_geom.cc
105   intern/math_geom_inline.c
106   intern/math_half.cc
107   intern/math_interp.cc
108   intern/math_matrix.cc
109   intern/math_matrix_c.cc
110   intern/math_rotation.cc
111   intern/math_rotation_c.cc
112   intern/math_solvers.cc
113   intern/math_statistics.cc
114   intern/math_time.cc
115   intern/math_vec.cc
116   intern/math_vector.cc
117   intern/math_vector_inline.c
118   intern/memory_cache.cc
119   intern/memory_counter.cc
120   intern/memory_utils.cc
121   intern/mesh_boolean.cc
122   intern/mesh_intersect.cc
123   intern/noise.cc
124   intern/noise_c.cc
125   intern/offset_indices.cc
126   intern/ordered_edge.cc
127   intern/path_utils.cc
128   intern/polyfill_2d.cc
129   intern/polyfill_2d_beautify.cc
130   intern/quadric.cc
131   intern/rand.cc
132   intern/rct.cc
133   intern/resource_scope.cc
134   intern/scanfill.c
135   intern/scanfill_utils.c
136   intern/serialize.cc
137   intern/session_uid.c
138   intern/smaa_textures.c
139   intern/sort.c
140   intern/sort_utils.c
141   intern/stack.c
142   intern/storage.cc
143   intern/string.c
144   intern/string_cursor_utf8.c
145   intern/string_ref.cc
146   intern/string_search.cc
147   intern/string_utf8.cc
148   intern/string_utils.cc
149   intern/system.c
150   intern/task_graph.cc
151   intern/task_iterator.c
152   intern/task_pool.cc
153   intern/task_range.cc
154   intern/task_scheduler.cc
155   intern/tempfile.cc
156   intern/threads.cc
157   intern/time.c
158   intern/timecode.c
159   intern/timeit.cc
160   intern/uuid.cc
161   intern/uvproject.cc
162   intern/vector.cc
163   intern/virtual_array.cc
164   intern/voxel.c
165   intern/winstuff.cc
166   intern/winstuff_dir.cc
167   intern/winstuff_registration.cc
168   # Private headers.
169   intern/BLI_mempool_private.h
171   # Header as source (included in C files above).
172   intern/kdtree_impl.h
173   intern/list_sort_impl.h
176   BLI_alloca.h
177   BLI_allocator.hh
178   BLI_any.hh
179   BLI_array.hh
180   BLI_array_state.hh
181   BLI_array_store.h
182   BLI_array_store_utils.h
183   BLI_array_utils.h
184   BLI_array_utils.hh
185   BLI_asan.h
186   BLI_assert.h
187   BLI_astar.h
188   BLI_atomic_disjoint_set.hh
189   BLI_binary_search.hh
190   BLI_bit_bool_conversion.hh
191   BLI_bit_group_vector.hh
192   BLI_bit_ref.hh
193   BLI_bit_span.hh
194   BLI_bit_span_ops.hh
195   BLI_bit_span_to_index_ranges.hh
196   BLI_bit_vector.hh
197   BLI_bitmap.h
198   BLI_bitmap_draw_2d.h
199   BLI_bounds.hh
200   BLI_bounds_types.hh
201   BLI_boxpack_2d.h
202   BLI_buffer.h
203   BLI_build_config.h
204   BLI_cache_mutex.hh
205   BLI_color.hh
206   BLI_color_mix.hh
207   BLI_compiler_attrs.h
208   BLI_compiler_compat.h
209   BLI_compiler_typecheck.h
210   BLI_compute_context.hh
211   BLI_concurrent_map.hh
212   BLI_console.h
213   BLI_convexhull_2d.h
214   BLI_cpp_type.hh
215   BLI_cpp_type_make.hh
216   BLI_cpp_types.hh
217   BLI_cpp_types_make.hh
218   BLI_delaunay_2d.hh
219   BLI_devirtualize_parameters.hh
220   BLI_dial_2d.h
221   BLI_disjoint_set.hh
222   BLI_dot_export.hh
223   BLI_dot_export_attribute_enums.hh
224   BLI_dynstr.h
225   BLI_easing.h
226   BLI_endian_defines.h
227   BLI_endian_switch.h
228   BLI_endian_switch_inline.h
229   BLI_enumerable_thread_specific.hh
230   BLI_expr_pylike_eval.h
231   BLI_fftw.hh
232   BLI_fileops.h
233   BLI_fileops.hh
234   BLI_fileops_types.h
235   BLI_filereader.h
236   BLI_fixed_width_int.hh
237   BLI_fixed_width_int_str.hh
238   BLI_fnmatch.h
239   BLI_function_ref.hh
240   BLI_generic_array.hh
241   BLI_generic_key.hh
242   BLI_generic_pointer.hh
243   BLI_generic_span.hh
244   BLI_generic_value_map.hh
245   BLI_generic_vector_array.hh
246   BLI_generic_virtual_array.hh
247   BLI_generic_virtual_vector_array.hh
248   BLI_ghash.h
249   BLI_gsqueue.h
250   BLI_hash.h
251   BLI_hash.hh
252   BLI_hash_md5.hh
253   BLI_hash_mm2a.hh
254   BLI_hash_mm3.hh
255   BLI_hash_tables.hh
256   BLI_heap.h
257   BLI_heap_simple.h
258   BLI_implicit_sharing.h
259   BLI_implicit_sharing.hh
260   BLI_implicit_sharing_ptr.hh
261   BLI_index_mask.hh
262   BLI_index_mask_expression.hh
263   BLI_index_mask_fwd.hh
264   BLI_index_range.hh
265   BLI_index_ranges_builder.hh
266   BLI_index_ranges_builder_fwd.hh
267   BLI_inplace_priority_queue.hh
268   BLI_iterator.h
269   BLI_jitter_2d.h
270   BLI_kdopbvh.hh
271   BLI_kdtree.h
272   BLI_kdtree_impl.h
273   BLI_lasso_2d.hh
274   BLI_lazy_threading.hh
275   BLI_length_parameterize.hh
276   BLI_linear_allocator.hh
277   BLI_linear_allocator_chunked_list.hh
278   BLI_link_utils.h
279   BLI_linklist.h
280   BLI_linklist_lockfree.h
281   BLI_linklist_stack.h
282   BLI_listbase.h
283   BLI_listbase_wrapper.hh
284   BLI_map.hh
285   BLI_map_slots.hh
286   BLI_math_angle_types.hh
287   BLI_math_axis_angle.hh
288   BLI_math_axis_angle_types.hh
289   BLI_math_base.h
290   BLI_math_base.hh
291   BLI_math_base_safe.h
292   BLI_math_basis_types.hh
293   BLI_math_bits.h
294   BLI_math_boolean.hh
295   BLI_math_color.h
296   BLI_math_color.hh
297   BLI_math_color_blend.h
298   BLI_math_constants.h
299   BLI_math_euler.hh
300   BLI_math_euler_types.hh
301   BLI_math_geom.h
302   BLI_math_half.hh
303   BLI_math_inline.h
304   BLI_math_interp.hh
305   BLI_math_matrix.h
306   BLI_math_matrix.hh
307   BLI_math_matrix_types.hh
308   BLI_math_mpq.hh
309   BLI_math_numbers.hh
310   BLI_math_quaternion.hh
311   BLI_math_quaternion_types.hh
312   BLI_math_rotation.h
313   BLI_math_rotation.hh
314   BLI_math_rotation_legacy.hh
315   BLI_math_rotation_types.hh
316   BLI_math_solvers.h
317   BLI_math_statistics.h
318   BLI_math_time.h
319   BLI_math_vector.h
320   BLI_math_vector.hh
321   BLI_math_vector_mpq_types.hh
322   BLI_math_vector_types.hh
323   BLI_math_vector_unroll.hh
324   BLI_memarena.h
325   BLI_memblock.h
326   BLI_memiter.h
327   BLI_memory_cache.hh
328   BLI_memory_counter.hh
329   BLI_memory_counter_fwd.hh
330   BLI_memory_utils.h
331   BLI_memory_utils.hh
332   BLI_mempool.h
333   BLI_mesh_boolean.hh
334   BLI_mesh_intersect.hh
335   BLI_mmap.h
336   BLI_multi_value_map.hh
337   BLI_noise.h
338   BLI_noise.hh
339   BLI_offset_indices.hh
340   BLI_offset_span.hh
341   BLI_ordered_edge.hh
342   BLI_parameter_pack_utils.hh
343   BLI_path_utils.hh
344   BLI_polyfill_2d.h
345   BLI_polyfill_2d_beautify.h
346   BLI_pool.hh
347   BLI_probing_strategies.hh
348   BLI_quadric.h
349   BLI_rand.h
350   BLI_rand.hh
351   BLI_random_access_iterator_mixin.hh
352   BLI_rect.h
353   BLI_resource_scope.hh
354   BLI_scanfill.h
355   BLI_serialize.hh
356   BLI_session_uid.h
357   BLI_set.hh
358   BLI_set_slots.hh
359   BLI_shared_cache.hh
360   BLI_simd.hh
361   BLI_smaa_textures.h
362   BLI_sort.h
363   BLI_sort.hh
364   BLI_sort_utils.h
365   BLI_span.hh
366   BLI_stack.h
367   BLI_stack.hh
368   BLI_strict_flags.h
369   BLI_string.h
370   BLI_string_cursor_utf8.h
371   BLI_string_ref.hh
372   BLI_string_search.hh
373   BLI_string_utf8.h
374   BLI_string_utf8_symbols.h
375   BLI_string_utils.hh
376   BLI_struct_equality_utils.hh
377   BLI_sub_frame.hh
378   BLI_subprocess.hh
379   BLI_sys_types.h
380   BLI_system.h
381   BLI_task.h
382   BLI_task.hh
383   BLI_task_size_hints.hh
384   BLI_tempfile.h
385   BLI_threads.h
386   BLI_time.h
387   BLI_time_utildefines.h
388   BLI_timecode.h
389   BLI_timeit.hh
390   BLI_timer.h
391   BLI_unique_sorted_indices.hh
392   BLI_unroll.hh
393   BLI_utildefines.h
394   BLI_utildefines_iter.h
395   BLI_utildefines_stack.h
396   BLI_utildefines_variadic.h
397   BLI_utility_mixins.hh
398   BLI_uuid.h
399   BLI_uvproject.h
400   BLI_vector.hh
401   BLI_vector_list.hh
402   BLI_vector_set.hh
403   BLI_vector_set_slots.hh
404   BLI_virtual_array.hh
405   BLI_virtual_array_fwd.hh
406   BLI_virtual_vector_array.hh
407   BLI_voxel.h
408   BLI_winstuff.h
409   BLI_winstuff_com.hh
411   # Without these files listed, they aren't known to CMake.
412   ../../../extern/json/include/json.hpp
415 set(LIB
416   PUBLIC bf::dna
417   PRIVATE bf::extern::fmtlib
418   PRIVATE bf::extern::xxhash
419   bf_intern_eigen
420   PRIVATE bf::intern::guardedalloc
421   extern_wcwidth
422   PRIVATE bf::intern::atomic
423   PRIVATE extern_fmtlib
424   PUBLIC bf::dependencies::optional::tbb
425   ${ZLIB_LIBRARIES}
426   ${ZSTD_LIBRARIES}
429 if(NOT WITH_PYTHON_MODULE)
430   list(APPEND SRC
431     intern/BLI_args.c
433     BLI_args.h
434   )
435 endif()
437 if(WITH_MEM_VALGRIND)
438   add_definitions(-DWITH_MEM_VALGRIND)
439 endif()
441 if(WITH_GMP)
442   add_definitions(-DWITH_GMP)
444   list(APPEND INC_SYS
445     ${GMP_INCLUDE_DIRS}
446   )
448   list(APPEND LIB
449     ${GMP_LIBRARIES}
450   )
451 endif()
453 if(WITH_FFTW3)
454   list(APPEND INC_SYS
455     ${FFTW3_INCLUDE_DIRS}
456   )
457   list(APPEND LIB
458     ${FFTW3_LIBRARIES}
459   )
460   add_definitions(-DWITH_FFTW3)
461   if(WITH_FFTW3_THREADS_F_SUPPORT)
462     add_definitions(-DWITH_FFTW3_THREADS_F_SUPPORT)
463   endif()
464 endif()
466 if(WIN32)
467   if(WITH_BLENDER_THUMBNAILER)
468     # Needed for querying the `thumbnailer .dll` in `winstuff.c`.
469     add_definitions(-DWITH_BLENDER_THUMBNAILER)
470   endif()
471   list(APPEND INC
472     ../../../intern/utfconv
473   )
474   list(APPEND LIB
475     bf_intern_utfconv
476     dxgi
477   )
478   list(APPEND SRC
479     intern/system_win32.cc
480   )
481 endif()
484 if(APPLE)
485   list(APPEND SRC
486     intern/fileops_apple.mm
487     intern/storage_apple.mm
488   )
489 endif()
491 if(UNIX AND NOT APPLE)
492   list(APPEND LIB
493     bf_intern_libc_compat
494   )
495 endif()
497 # no need to compile object files for inline headers.
498 set_source_files_properties(
499   intern/math_base_inline.c
500   intern/math_base_safe_inline.c
501   intern/math_bits_inline.c
502   intern/math_color_blend_inline.c
503   intern/math_color_inline.c
504   intern/math_geom_inline.c
505   intern/math_vector_inline.c
506   PROPERTIES HEADER_FILE_ONLY TRUE
509 blender_add_lib(bf_blenlib "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
510 add_library(bf::blenlib ALIAS bf_blenlib)
512 if(WITH_GTESTS)
513   set(TEST_SRC
514     tests/BLI_any_test.cc
515     tests/BLI_array_state_test.cc
516     tests/BLI_array_store_test.cc
517     tests/BLI_array_test.cc
518     tests/BLI_array_utils_test.cc
519     tests/BLI_binary_search_test.cc
520     tests/BLI_bit_group_vector_test.cc
521     tests/BLI_bit_ref_test.cc
522     tests/BLI_bit_span_test.cc
523     tests/BLI_bit_vector_test.cc
524     tests/BLI_bitmap_test.cc
525     tests/BLI_bounds_test.cc
526     tests/BLI_build_config_test.cc
527     tests/BLI_color_test.cc
528     tests/BLI_convexhull_2d_test.cc
529     tests/BLI_cpp_type_test.cc
530     tests/BLI_delaunay_2d_test.cc
531     tests/BLI_disjoint_set_test.cc
532     tests/BLI_expr_pylike_eval_test.cc
533     tests/BLI_fileops_test.cc
534     tests/BLI_fixed_width_int_test.cc
535     tests/BLI_function_ref_test.cc
536     tests/BLI_generic_array_test.cc
537     tests/BLI_generic_span_test.cc
538     tests/BLI_generic_vector_array_test.cc
539     tests/BLI_ghash_test.cc
540     tests/BLI_hash_mm2a_test.cc
541     tests/BLI_heap_simple_test.cc
542     tests/BLI_heap_test.cc
543     tests/BLI_implicit_sharing_test.cc
544     tests/BLI_index_mask_expression_test.cc
545     tests/BLI_index_mask_test.cc
546     tests/BLI_index_range_test.cc
547     tests/BLI_index_ranges_builder_test.cc
548     tests/BLI_inplace_priority_queue_test.cc
549     tests/BLI_kdopbvh_test.cc
550     tests/BLI_kdtree_test.cc
551     tests/BLI_length_parameterize_test.cc
552     tests/BLI_linear_allocator_chunked_list_test.cc
553     tests/BLI_linear_allocator_test.cc
554     tests/BLI_linklist_lockfree_test.cc
555     tests/BLI_listbase_test.cc
556     tests/BLI_map_test.cc
557     tests/BLI_math_base_safe_test.cc
558     tests/BLI_math_base_test.cc
559     tests/BLI_math_bits_test.cc
560     tests/BLI_math_color_test.cc
561     tests/BLI_math_geom_test.cc
562     tests/BLI_math_half_test.cc
563     tests/BLI_math_interp_test.cc
564     tests/BLI_math_matrix_test.cc
565     tests/BLI_math_matrix_types_test.cc
566     tests/BLI_math_rotation_test.cc
567     tests/BLI_math_rotation_types_test.cc
568     tests/BLI_math_solvers_test.cc
569     tests/BLI_math_time_test.cc
570     tests/BLI_math_vector_test.cc
571     tests/BLI_math_vector_types_test.cc
572     tests/BLI_memiter_test.cc
573     tests/BLI_memory_cache_test.cc
574     tests/BLI_memory_counter_test.cc
575     tests/BLI_memory_utils_test.cc
576     tests/BLI_mesh_boolean_test.cc
577     tests/BLI_mesh_intersect_test.cc
578     tests/BLI_multi_value_map_test.cc
579     tests/BLI_offset_indices_test.cc
580     tests/BLI_path_utils_test.cc
581     tests/BLI_polyfill_2d_test.cc
582     tests/BLI_pool_test.cc
583     tests/BLI_random_access_iterator_mixin_test.cc
584     tests/BLI_ressource_strings.h
585     tests/BLI_serialize_test.cc
586     tests/BLI_session_uid_test.cc
587     tests/BLI_set_test.cc
588     tests/BLI_span_test.cc
589     tests/BLI_stack_cxx_test.cc
590     tests/BLI_stack_test.cc
591     tests/BLI_string_ref_test.cc
592     tests/BLI_string_search_test.cc
593     tests/BLI_string_test.cc
594     tests/BLI_string_utf8_test.cc
595     tests/BLI_string_utils_test.cc
596     tests/BLI_task_graph_test.cc
597     tests/BLI_task_test.cc
598     tests/BLI_tempfile_test.cc
599     tests/BLI_unique_sorted_indices_test.cc
600     tests/BLI_utildefines_test.cc
601     tests/BLI_uuid_test.cc
602     tests/BLI_vector_set_test.cc
603     tests/BLI_vector_test.cc
604     tests/BLI_virtual_array_test.cc
606     tests/BLI_exception_safety_test_utils.hh
607   )
608   set(TEST_INC
609     ../imbuf
610   )
611   set(TEST_LIB
612     bf_blenlib
613   )
614   blender_add_test_suite_executable(BLI "${TEST_SRC}" "${INC};${TEST_INC}" "${INC_SYS}" "${LIB};${TEST_LIB}")
616   add_subdirectory(tests/performance)
617 endif()