Merged changes in the trunk up to revision 35203.
[blender.git] / source / blender / makesrna / intern / CMakeLists.txt
1 # -*- mode: cmake; indent-tabs-mode: t; -*-
2 # $Id: CMakeLists.txt 17433 2008-11-12 21:16:53Z blendix $
3 # ***** BEGIN GPL LICENSE BLOCK *****
4 #
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software Foundation,
17 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 #
19 # The Original Code is Copyright (C) 2006, Blender Foundation
20 # All rights reserved.
21 #
22 # The Original Code is: all of this file.
23 #
24 # Contributor(s): Jacques Beaurain.
25 #
26 # ***** END GPL LICENSE BLOCK *****
27
28 # Generated code has some unused vars we can ignore.
29 remove_strict_flags()
30
31 # message(STATUS "Configuring makesrna")
32
33 file(GLOB DEFSRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.c")
34 file(GLOB APISRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*_api.c")
35 list(REMOVE_ITEM DEFSRC rna_access.c rna_define.c makesrna.c)
36 list(REMOVE_ITEM DEFSRC ${APISRC})
37  
38 string(REGEX REPLACE "rna_([a-zA-Z0-9_-]*).c" "${CMAKE_CURRENT_BINARY_DIR}/rna_\\1_gen.c" GENSRC "${DEFSRC}")
39 set_source_files_properties(GENSRC PROPERTIES GENERATED true)
40
41 set(SRC_RNA_INC
42         ../RNA_access.h
43         ../RNA_define.h
44         ../RNA_documentation.h
45         ../RNA_enum_types.h
46         ../RNA_types.h
47 )
48
49 set(SRC
50         makesrna.c
51         rna_define.c
52         ${DEFSRC}
53         ${APISRC}
54         ../../../../intern/guardedalloc/intern/mallocn.c
55         ../../../../intern/guardedalloc/intern/mmap_win.c
56 )
57
58 set(INC
59 )
60
61 if(WITH_PYTHON)
62         add_definitions(-DWITH_PYTHON)
63 endif()
64
65 if(WITH_GAMEENGINE)
66         add_definitions(-DWITH_GAMEENGINE)
67 endif()
68
69 if(WITH_IMAGE_OPENEXR)
70         add_definitions(-DWITH_OPENEXR)
71 endif()
72
73 if(WITH_IMAGE_TIFF)
74         add_definitions(-DWITH_TIFF)
75 endif()
76
77 if(WITH_IMAGE_OPENJPEG)
78         add_definitions(-DWITH_OPENJPEG)
79 endif()
80
81 if(WITH_IMAGE_DDS)
82         add_definitions(-DWITH_DDS)
83 endif()
84
85 if(WITH_IMAGE_CINEON)
86         add_definitions(-DWITH_CINEON)
87 endif()
88
89 if(WITH_IMAGE_HDR)
90         add_definitions(-DWITH_HDR)
91 endif()
92
93 if(WITH_CODEC_QUICKTIME)
94         list(APPEND INC ../../quicktime)
95         add_definitions(-DWITH_QUICKTIME)
96 endif()
97
98 if(WITH_CODEC_FFMPEG)
99         list(APPEND INC ${FFMPEG_INC})
100         add_definitions(-DWITH_FFMPEG)
101 endif()
102
103 if(WITH_LCMS)
104         list(APPEND INC ${LCMS_INCLUDE_DIR})
105         add_definitions(-DWITH_LCMS)
106 endif()
107
108 if(NOT WITH_MOD_FLUID)
109         add_definitions(-DDISABLE_ELBEEM)
110 endif()
111
112 if(WITH_FFTW3)
113         add_definitions(-DFFTW3=1)
114 endif()
115
116 if(WITH_SDL)
117         add_definitions(-DWITH_SDL)
118 endif()
119
120 if(WITH_OPENAL)
121         add_definitions(-DWITH_OPENAL)
122 endif()
123
124 if(WITH_JACK)
125         add_definitions(-DWITH_JACK)
126 endif()
127
128 # Build makesrna executable
129 blender_include_dirs(
130         .
131         ..
132         ../../blenkernel
133         ../../blenloader
134         ../../blenlib
135         ../../blenfont
136         ../../gpu
137         ../../imbuf
138         ../../ikplugin
139         ../../makesdna
140         ../../windowmanager
141         ../../editors/include
142         ../../render/extern/include
143         ../../freestyle
144         ../../../../extern/glew/include
145         ../../../../intern/audaspace/intern
146         ../../../../intern/guardedalloc
147         ../../../../intern/memutil
148 )
149
150 add_executable(makesrna ${SRC} ${SRC_RNA_INC} ${SRC_DNA_INC})
151 target_link_libraries(makesrna bf_dna)
152
153 # Output rna_*_gen.c
154 # note (linux only): with crashes try add this after COMMAND: valgrind --leak-check=full --track-origins=yes
155 add_custom_command(
156         OUTPUT ${GENSRC}
157         COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesrna ${CMAKE_CURRENT_BINARY_DIR}/
158         DEPENDS makesrna
159 )
160
161 # Build bf_rna
162 set(SRC
163         rna_access.c
164         ${GENSRC}
165
166         ${SRC_RNA_INC}
167         rna_internal.h
168         rna_internal_types.h
169         rna_nodetree_types.h
170 )
171
172 blender_add_lib(bf_rna "${SRC}" "${INC}")