Cleanup: remove contributors for CMake files
[blender.git] / source / blender / makesdna / intern / 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 # message(STATUS "Configuring makesdna")
22
23 add_definitions(-DWITH_DNA_GHASH)
24
25 blender_include_dirs(
26         ../../../../intern/guardedalloc
27         ../../../../intern/atomic
28         ../../blenlib
29         ..
30 )
31
32
33 # -----------------------------------------------------------------------------
34 # Build makesdna executable
35 set(SRC
36         makesdna.c
37         ../../../../intern/guardedalloc/intern/mallocn.c
38         ../../../../intern/guardedalloc/intern/mallocn_guarded_impl.c
39         ../../../../intern/guardedalloc/intern/mallocn_lockfree_impl.c
40 )
41
42 if(WIN32 AND NOT UNIX)
43         list(APPEND SRC
44                 ../../../../intern/guardedalloc/intern/mmap_win.c
45         )
46 endif()
47
48 # SRC_DNA_INC is defined in the parent dir
49
50 add_cc_flags_custom_test(makesdna)
51 setup_platform_linker_flags()
52
53 add_executable(makesdna ${SRC} ${SRC_DNA_INC})
54
55 # Output dna.c
56 add_custom_command(
57         OUTPUT
58                 ${CMAKE_CURRENT_BINARY_DIR}/dna.c
59                 ${CMAKE_CURRENT_BINARY_DIR}/dna_type_offsets.h
60         COMMAND
61                 "$<TARGET_FILE:makesdna>"
62                 ${CMAKE_CURRENT_BINARY_DIR}/dna.c
63                 ${CMAKE_CURRENT_BINARY_DIR}/dna_type_offsets.h
64                 ${CMAKE_SOURCE_DIR}/source/blender/makesdna/
65         DEPENDS makesdna
66 )
67
68
69 # -----------------------------------------------------------------------------
70 # Build bf_dna library
71 set(INC
72
73 )
74
75 set(INC_SYS
76
77 )
78
79 set(SRC
80         dna_genfile.c
81         ${CMAKE_CURRENT_BINARY_DIR}/dna.c
82         ${SRC_DNA_INC}
83 )
84
85 set_source_files_properties(
86         ${CMAKE_CURRENT_BINARY_DIR}/dna.c
87         ${CMAKE_CURRENT_BINARY_DIR}/dna_type_offsets.h
88         PROPERTIES GENERATED TRUE
89 )
90
91 blender_add_lib(bf_dna "${SRC}" "${INC}" "${INC_SYS}")
92
93
94 # -----------------------------------------------------------------------------
95 # Build bf_dna_blenlib library
96 set(INC
97
98 )
99
100 set(INC_SYS
101
102 )
103
104 set(SRC
105         ../../blenlib/intern/BLI_ghash.c
106         ../../blenlib/intern/BLI_ghash_utils.c
107         ../../blenlib/intern/BLI_mempool.c
108         ../../blenlib/intern/endian_switch.c
109         ../../blenlib/intern/hash_mm2a.c
110         ../../blenlib/intern/listbase.c
111 )
112
113 blender_add_lib(bf_dna_blenlib "${SRC}" "${INC}" "${INC_SYS}")