Merged changes in the trunk up to revision 34193.
[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_enum_types.h
45         ../RNA_types.h
46 )
47
48 set(SRC
49         makesrna.c
50         rna_define.c
51         ${DEFSRC}
52         ${APISRC}
53         ../../../../intern/guardedalloc/intern/mallocn.c
54         ../../../../intern/guardedalloc/intern/mmap_win.c
55 )
56
57 set(INC
58 )
59
60 if(WITH_PYTHON)
61         add_definitions(-DWITH_PYTHON)
62 endif()
63
64 if(WITH_GAMEENGINE)
65         add_definitions(-DWITH_GAMEENGINE)
66 endif()
67
68 if(WITH_IMAGE_OPENEXR)
69         add_definitions(-DWITH_OPENEXR)
70 endif()
71
72 if(WITH_IMAGE_TIFF)
73         add_definitions(-DWITH_TIFF)
74 endif()
75
76 if(WITH_IMAGE_OPENJPEG)
77         add_definitions(-DWITH_OPENJPEG)
78 endif()
79
80 if(WITH_IMAGE_DDS)
81         add_definitions(-DWITH_DDS)
82 endif()
83
84 if(WITH_IMAGE_CINEON)
85         add_definitions(-DWITH_CINEON)
86 endif()
87
88 if(WITH_IMAGE_HDR)
89         add_definitions(-DWITH_HDR)
90 endif()
91
92 if(WITH_CODEC_QUICKTIME)
93         list(APPEND INC ../../quicktime)
94         add_definitions(-DWITH_QUICKTIME)
95 endif()
96
97 if(WITH_CODEC_FFMPEG)
98         list(APPEND INC ${FFMPEG_INC})
99         add_definitions(-DWITH_FFMPEG)
100 endif()
101
102 if(WITH_LCMS)
103         list(APPEND INC ${LCMS_INCLUDE_DIR})
104         add_definitions(-DWITH_LCMS)
105 endif()
106
107 if(NOT WITH_MOD_FLUID)
108         add_definitions(-DDISABLE_ELBEEM)
109 endif()
110
111 if(WITH_FFTW3)
112         add_definitions(-DFFTW3=1)
113 endif()
114
115 if(WITH_SDL)
116         add_definitions(-DWITH_SDL)
117 endif()
118
119 if(WITH_OPENAL)
120         add_definitions(-DWITH_OPENAL)
121 endif()
122
123 if(WITH_JACK)
124         add_definitions(-DWITH_JACK)
125 endif()
126
127 # Build makesrna executable
128 blender_include_dirs(
129         .
130         ..
131         ../../blenkernel
132         ../../blenlib
133         ../../blenfont
134         ../../gpu
135         ../../imbuf
136         ../../ikplugin
137         ../../makesdna
138         ../../windowmanager
139         ../../editors/include
140         ../../render/extern/include
141         ../../freestyle
142         ../../../../extern/glew/include
143         ../../../../intern/audaspace/intern
144         ../../../../intern/guardedalloc
145         ../../../../intern/memutil
146 )
147
148 add_executable(makesrna ${SRC} ${SRC_RNA_INC} ${SRC_DNA_INC})
149 target_link_libraries(makesrna bf_dna)
150
151 # Output rna_*_gen.c
152 # note (linux only): with crashes try add this after COMMAND: valgrind --leak-check=full --track-origins=yes
153 add_custom_command(
154         OUTPUT ${GENSRC}
155         COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesrna ${CMAKE_CURRENT_BINARY_DIR}/
156         DEPENDS makesrna
157 )
158
159 # Build bf_rna
160 set(SRC
161         rna_access.c
162         ${GENSRC}
163
164         ${SRC_RNA_INC}
165         rna_internal.h
166         rna_internal_types.h
167         rna_nodetree_types.h
168 )
169
170 blender_add_lib(bf_rna "${SRC}" "${INC}")