Merged changes in the trunk up to revision 41768.
[blender-staging.git] / source / blender / makesrna / intern / CMakeLists.txt
1 # -*- mode: cmake; indent-tabs-mode: t; -*-
2 # ***** BEGIN GPL LICENSE BLOCK *****
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software Foundation,
16 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 #
18 # The Original Code is Copyright (C) 2006, Blender Foundation
19 # All rights reserved.
20 #
21 # The Original Code is: all of this file.
22 #
23 # Contributor(s): Jacques Beaurain.
24 #
25 # ***** END GPL LICENSE BLOCK *****
26
27 # Generated code has some unused vars we can ignore.
28 remove_strict_flags()
29
30 # message(STATUS "Configuring makesrna")
31
32 # files rna_access.c rna_define.c makesrna.c intentionally excluded.
33 set(DEFSRC
34         rna_ID.c
35         rna_action.c
36         rna_actuator.c
37         rna_animation.c
38         rna_animviz.c
39         rna_armature.c
40         rna_boid.c
41         rna_brush.c
42         rna_camera.c
43         rna_cloth.c
44         rna_color.c
45         rna_constraint.c
46         rna_context.c
47         rna_controller.c
48         rna_curve.c
49         rna_dynamicpaint.c
50         rna_fcurve.c
51         rna_fluidsim.c
52         rna_gpencil.c
53         rna_group.c
54         rna_image.c
55         rna_key.c
56         rna_lamp.c
57         rna_lattice.c
58         rna_linestyle.c
59         rna_main.c
60         rna_material.c
61         rna_mesh.c
62         rna_meta.c
63         rna_modifier.c
64         rna_movieclip.c
65         rna_nla.c
66         rna_nodetree.c
67         rna_object.c
68         rna_object_force.c
69         rna_packedfile.c
70         rna_particle.c
71         rna_pose.c
72         rna_property.c
73         rna_render.c
74         rna_rna.c
75         rna_scene.c
76         rna_screen.c
77         rna_sculpt_paint.c
78         rna_sensor.c
79         rna_sequencer.c
80         rna_smoke.c
81         rna_sound.c
82         rna_space.c
83         rna_speaker.c
84         rna_test.c
85         rna_text.c
86         rna_texture.c
87         rna_timeline.c
88         rna_tracking.c
89         rna_ui.c
90         rna_userdef.c
91         rna_vfont.c
92         rna_wm.c
93         rna_world.c
94 )
95
96 set(APISRC
97         rna_action_api.c
98         rna_actuator_api.c
99         rna_animation_api.c
100         rna_armature_api.c
101         rna_camera_api.c
102         rna_controller_api.c
103         rna_fcurve_api.c
104         rna_image_api.c
105         rna_main_api.c
106         rna_material_api.c
107         rna_mesh_api.c
108         rna_texture_api.c
109         rna_object_api.c
110         rna_pose_api.c
111         rna_scene_api.c
112         rna_sensor_api.c
113         rna_sequencer_api.c
114         rna_text_api.c
115         rna_ui_api.c
116         rna_wm_api.c
117 )
118
119 string(REGEX REPLACE "rna_([a-zA-Z0-9_-]*).c" "${CMAKE_CURRENT_BINARY_DIR}/rna_\\1_gen.c" GENSRC "${DEFSRC}")
120 set_source_files_properties(GENSRC PROPERTIES GENERATED true)
121
122 set(SRC_RNA_INC
123         ../RNA_access.h
124         ../RNA_define.h
125         ../RNA_documentation.h
126         ../RNA_enum_types.h
127         ../RNA_types.h
128 )
129
130 set(SRC
131         makesrna.c
132         rna_define.c
133         ${DEFSRC}
134         ${APISRC}
135         ../../../../intern/guardedalloc/intern/mallocn.c
136         ../../../../intern/guardedalloc/intern/mmap_win.c
137 )
138
139 set(INC
140
141 )
142
143 set(INC_SYS
144
145 )
146
147
148 if(WITH_PYTHON)
149         add_definitions(-DWITH_PYTHON)
150 endif()
151
152 if(WITH_GAMEENGINE)
153         add_definitions(-DWITH_GAMEENGINE)
154 endif()
155
156 if(WITH_IMAGE_OPENEXR)
157         add_definitions(-DWITH_OPENEXR)
158 endif()
159
160 if(WITH_IMAGE_TIFF)
161         add_definitions(-DWITH_TIFF)
162 endif()
163
164 if(WITH_IMAGE_OPENJPEG)
165         add_definitions(-DWITH_OPENJPEG)
166 endif()
167
168 if(WITH_IMAGE_DDS)
169         add_definitions(-DWITH_DDS)
170 endif()
171
172 if(WITH_IMAGE_CINEON)
173         add_definitions(-DWITH_CINEON)
174 endif()
175
176 if(WITH_IMAGE_HDR)
177         add_definitions(-DWITH_HDR)
178 endif()
179
180 if(WITH_IMAGE_FRAMESERVER)
181         add_definitions(-DWITH_FRAMESERVER)
182 endif()
183
184 if(WITH_AUDASPACE)
185         add_definitions(-DWITH_AUDASPACE)
186 endif()
187
188 if(WITH_CODEC_QUICKTIME)
189         list(APPEND INC
190                 ../../quicktime
191         )
192         add_definitions(-DWITH_QUICKTIME)
193 endif()
194
195 if(WITH_CODEC_FFMPEG)
196         list(APPEND INC_SYS
197                 ${FFMPEG_INCLUDE_DIRS}
198         )
199         add_definitions(-DWITH_FFMPEG)
200 endif()
201
202 if(WITH_MOD_FLUID)
203         add_definitions(-DWITH_MOD_FLUID)
204 endif()
205
206 if(WITH_FFTW3)
207         add_definitions(-DWITH_FFTW3)
208 endif()
209
210 if(WITH_SDL)
211         add_definitions(-DWITH_SDL)
212 endif()
213
214 if(WITH_OPENAL)
215         add_definitions(-DWITH_OPENAL)
216 endif()
217
218 if(WITH_JACK)
219         add_definitions(-DWITH_JACK)
220 endif()
221
222 if(WITH_OPENCOLLADA)
223         add_definitions(-DWITH_COLLADA)
224 endif()
225
226 if(WITH_INTERNATIONAL)
227         add_definitions(-DWITH_INTERNATIONAL)
228 endif()
229
230 # Build makesrna executable
231 blender_include_dirs(
232         .
233         ..
234         ../../blenkernel
235         ../../blenloader
236         ../../blenlib
237         ../../blenfont
238         ../../gpu
239         ../../imbuf
240         ../../ikplugin
241         ../../makesdna
242         ../../windowmanager
243         ../../editors/include
244         ../../render/extern/include
245         ../../freestyle
246         ../../../../intern/audaspace/intern
247         ../../../../intern/guardedalloc
248         ../../../../intern/memutil
249 )
250
251 blender_include_dirs_sys(
252         ${GLEW_INCLUDE_PATH}
253 )
254
255 add_executable(makesrna ${SRC} ${SRC_RNA_INC} ${SRC_DNA_INC})
256 target_link_libraries(makesrna bf_dna)
257 target_link_libraries(makesrna bf_dna_blenlib)
258
259 # Output rna_*_gen.c
260 # note (linux only): with crashes try add this after COMMAND: valgrind --leak-check=full --track-origins=yes
261 add_custom_command(
262         OUTPUT ${GENSRC}
263         COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesrna ${CMAKE_CURRENT_BINARY_DIR}/
264         DEPENDS makesrna
265 )
266
267 # Build bf_rna
268 set(SRC
269         rna_access.c
270         ${GENSRC}
271
272         ${SRC_RNA_INC}
273         rna_internal.h
274         rna_internal_types.h
275         rna_nodetree_types.h
276 )
277
278 blender_add_lib(bf_rna "${SRC}" "${INC}" "${INC_SYS}")