Merged changes in the trunk up to revision 32684.
[blender.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 FILE(GLOB DEFSRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.c")
31 FILE(GLOB APISRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*_api.c")
32 LIST(REMOVE_ITEM DEFSRC rna_access.c rna_define.c makesrna.c)
33 LIST(REMOVE_ITEM DEFSRC ${APISRC})
34  
35 STRING(REGEX REPLACE "rna_([a-zA-Z0-9_-]*).c" "${CMAKE_CURRENT_BINARY_DIR}/rna_\\1_gen.c" GENSRC "${DEFSRC}")
36
37 SET(SRC
38         makesrna.c
39         rna_define.c
40         ${DEFSRC}
41         ${APISRC}
42         ../../../../intern/guardedalloc/intern/mallocn.c
43         ../../../../intern/guardedalloc/intern/mmap_win.c)
44
45 INCLUDE_DIRECTORIES(
46         ../../../../intern/audaspace/intern
47         ../../../../intern/guardedalloc
48         ../../../../intern/memutil
49         ..
50         ../../makesdna
51         ../../blenkernel
52         ../../blenlib
53         ../../ikplugin
54         ../../windowmanager
55         ../../editors/include
56         ../../gpu
57         ../../imbuf
58         ../../render/extern/include
59         ../../../../extern/glew/include
60         ../../freestyle
61         . )
62
63 FILE(GLOB INC_FILES ../*.h ../../makesdna/*.h)
64
65 IF(NOT WITH_PYTHON)
66         ADD_DEFINITIONS(-DDISABLE_PYTHON)
67 ENDIF(NOT WITH_PYTHON)
68
69 IF(WIN32)
70         LIST(APPEND INC ${PTHREADS_INC})
71 ENDIF(WIN32)
72
73 IF(WITH_GAMEENGINE)
74         ADD_DEFINITIONS(-DGAMEBLENDER)
75 ENDIF(WITH_GAMEENGINE)
76
77 IF(WITH_IMAGE_OPENEXR)
78         ADD_DEFINITIONS(-DWITH_OPENEXR)
79 ENDIF(WITH_IMAGE_OPENEXR)
80
81 IF(WITH_IMAGE_TIFF)
82         ADD_DEFINITIONS(-DWITH_TIFF)
83 ENDIF(WITH_IMAGE_TIFF)
84
85 IF(WITH_IMAGE_OPENJPEG)
86         ADD_DEFINITIONS(-DWITH_OPENJPEG)
87 ENDIF(WITH_IMAGE_OPENJPEG)
88
89 IF(WITH_IMAGE_DDS)
90         ADD_DEFINITIONS(-DWITH_DDS)
91 ENDIF(WITH_IMAGE_DDS)
92
93 IF(WITH_IMAGE_CINEON)
94         ADD_DEFINITIONS(-DWITH_CINEON)
95 ENDIF(WITH_IMAGE_CINEON)
96
97 IF(WITH_IMAGE_HDR)
98         ADD_DEFINITIONS(-DWITH_HDR)
99 ENDIF(WITH_IMAGE_HDR)
100
101 IF(WITH_QUICKTIME)
102         LIST(APPEND INC ../../quicktime)
103         ADD_DEFINITIONS(-DWITH_QUICKTIME)
104 ENDIF(WITH_QUICKTIME)
105
106 IF(WITH_FFMPEG)
107         LIST(APPEND INC ${FFMPEG_INC})
108         ADD_DEFINITIONS(-DWITH_FFMPEG)
109 ENDIF(WITH_FFMPEG)
110
111 IF(WITH_LCMS)
112         LIST(APPEND INC ${LCMS_INCLUDE_DIR})
113         ADD_DEFINITIONS(-DWITH_LCMS)
114 ENDIF(WITH_LCMS)
115
116 IF(NOT WITH_MOD_FLUID)
117         ADD_DEFINITIONS(-DDISABLE_ELBEEM)
118 ENDIF(NOT WITH_MOD_FLUID)
119
120 IF(WITH_FFTW3)
121         ADD_DEFINITIONS(-DFFTW3=1)
122 ENDIF(WITH_FFTW3)
123
124 IF(WITH_SDL)
125         ADD_DEFINITIONS(-DWITH_SDL)
126 ENDIF(WITH_SDL)
127
128 IF(WITH_OPENAL)
129         ADD_DEFINITIONS(-DWITH_OPENAL)
130 ENDIF(WITH_OPENAL)
131
132 IF(WITH_JACK)
133         ADD_DEFINITIONS(-DWITH_JACK)
134 ENDIF(WITH_JACK)
135
136 # Build makesrna executable
137 ADD_EXECUTABLE(makesrna ${SRC} ${INC_FILES})
138 TARGET_LINK_LIBRARIES(makesrna bf_dna)
139
140 # Output rna_*_gen.c
141 # note (linux only): with crashes try add this after COMMAND: valgrind --leak-check=full --track-origins=yes
142 ADD_CUSTOM_COMMAND(
143         OUTPUT ${GENSRC}
144         COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesrna ${CMAKE_CURRENT_BINARY_DIR}/
145         DEPENDS makesrna
146 )
147
148 # Build bf_rna
149 SET(SRC rna_access.c ${GENSRC})
150 BLENDERLIB(bf_rna "${SRC}" "${INC}")
151
152 MESSAGE(STATUS "Configuring makesrna")