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