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