last commit to fix warnings didnt set them at all, not it works as it should.
[blender-staging.git] / source / blender / makesrna / intern / CMakeLists.txt
1 # $Id: CMakeLists.txt 17433 2008-11-12 21:16:53Z blendix $
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 file(GLOB DEFSRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.c")
33 file(GLOB APISRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*_api.c")
34 list(REMOVE_ITEM DEFSRC rna_access.c rna_define.c makesrna.c)
35 list(REMOVE_ITEM DEFSRC ${APISRC})
36  
37 string(REGEX REPLACE "rna_([a-zA-Z0-9_-]*).c" "${CMAKE_CURRENT_BINARY_DIR}/rna_\\1_gen.c" GENSRC "${DEFSRC}")
38 set_source_files_properties(GENSRC PROPERTIES GENERATED true)
39
40
41 set(SRC
42         makesrna.c
43         rna_define.c
44         ${DEFSRC}
45         ${APISRC}
46         ../../../../intern/guardedalloc/intern/mallocn.c
47         ../../../../intern/guardedalloc/intern/mmap_win.c
48 )
49
50 include_directories(
51         ../../../../intern/audaspace/intern
52         ../../../../intern/guardedalloc
53         ../../../../intern/memutil
54         ..
55         ../../makesdna
56         ../../blenkernel
57         ../../blenlib
58         ../../blenfont
59         ../../ikplugin
60         ../../windowmanager
61         ../../editors/include
62         ../../gpu
63         ../../imbuf
64         ../../render/extern/include
65         ../../../../extern/glew/include
66         .
67 )
68
69 file(GLOB INC_FILES ../*.h ../../makesdna/*.h)
70
71 if(WITH_PYTHON)
72         add_definitions(-DWITH_PYTHON)
73 endif()
74
75 if(WITH_GAMEENGINE)
76         add_definitions(-DWITH_GAMEENGINE)
77 endif()
78
79 if(WITH_IMAGE_OPENEXR)
80         add_definitions(-DWITH_OPENEXR)
81 endif()
82
83 if(WITH_IMAGE_TIFF)
84         add_definitions(-DWITH_TIFF)
85 endif()
86
87 if(WITH_IMAGE_OPENJPEG)
88         add_definitions(-DWITH_OPENJPEG)
89 endif()
90
91 if(WITH_IMAGE_DDS)
92         add_definitions(-DWITH_DDS)
93 endif()
94
95 if(WITH_IMAGE_CINEON)
96         add_definitions(-DWITH_CINEON)
97 endif()
98
99 if(WITH_IMAGE_HDR)
100         add_definitions(-DWITH_HDR)
101 endif()
102
103 if(WITH_CODEC_QUICKTIME)
104         list(APPEND INC ../../quicktime)
105         add_definitions(-DWITH_QUICKTIME)
106 endif()
107
108 if(WITH_CODEC_FFMPEG)
109         list(APPEND INC ${FFMPEG_INC})
110         add_definitions(-DWITH_FFMPEG)
111 endif()
112
113 if(WITH_LCMS)
114         list(APPEND INC ${LCMS_INCLUDE_DIR})
115         add_definitions(-DWITH_LCMS)
116 endif()
117
118 if(NOT WITH_MOD_FLUID)
119         add_definitions(-DDISABLE_ELBEEM)
120 endif()
121
122 if(WITH_FFTW3)
123         add_definitions(-DFFTW3=1)
124 endif()
125
126 if(WITH_SDL)
127         add_definitions(-DWITH_SDL)
128 endif()
129
130 if(WITH_OPENAL)
131         add_definitions(-DWITH_OPENAL)
132 endif()
133
134 if(WITH_JACK)
135         add_definitions(-DWITH_JACK)
136 endif()
137
138 if(WITH_OPENCOLLADA)
139         add_definitions(-DWITH_COLLADA)
140 endif()
141
142 # Build makesrna executable
143 add_executable(makesrna ${SRC} ${INC_FILES})
144 target_link_libraries(makesrna bf_dna)
145
146 # Output rna_*_gen.c
147 # note (linux only): with crashes try add this after COMMAND: valgrind --leak-check=full --track-origins=yes
148 add_custom_command(
149         OUTPUT ${GENSRC}
150         COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesrna ${CMAKE_CURRENT_BINARY_DIR}/
151         DEPENDS makesrna
152 )
153
154 # Build bf_rna
155 set(SRC
156         rna_access.c
157         ${GENSRC}
158
159         ../RNA_access.h
160         ../RNA_define.h
161         ../RNA_enum_types.h
162         ../RNA_types.h
163
164         rna_internal.h
165         rna_internal_types.h
166         rna_nodetree_types.h
167 )
168
169 blenderlib(bf_rna "${SRC}" "${INC}")