part 1 of merge from trunk at r30358; it compiles, but doesn't link quite yet :)
[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         ../../bmesh
49         ../../blenlib
50         ../../ikplugin
51         ../../windowmanager
52         ../../editors/include
53         ../../gpu
54         ../../imbuf
55         ../../render/extern/include
56         ../../../../extern/glew/include
57         . )
58
59 FILE(GLOB INC_FILES ../*.h ../../makesdna/*.h)
60
61 IF(NOT WITH_PYTHON)
62         ADD_DEFINITIONS(-DDISABLE_PYTHON)
63 ENDIF(NOT WITH_PYTHON)
64
65 IF(WIN32)
66         SET(INC ${INC} ${PTHREADS_INC})
67 ENDIF(WIN32)
68
69 IF(WITH_GAMEENGINE)
70         ADD_DEFINITIONS(-DGAMEBLENDER)
71 ENDIF(WITH_GAMEENGINE)
72
73 IF(WITH_OPENEXR)
74         ADD_DEFINITIONS(-DWITH_OPENEXR)
75 ENDIF(WITH_OPENEXR)
76
77 IF(WITH_TIFF)
78         ADD_DEFINITIONS(-DWITH_TIFF)
79 ENDIF(WITH_TIFF)
80
81 IF(WITH_OPENJPEG)
82         ADD_DEFINITIONS(-DWITH_OPENJPEG)
83 ENDIF(WITH_OPENJPEG)
84
85 IF(WITH_DDS)
86         ADD_DEFINITIONS(-DWITH_DDS)
87 ENDIF(WITH_DDS)
88
89 IF(WITH_QUICKTIME)
90         SET(INC ${INC} ../../quicktime)
91         ADD_DEFINITIONS(-DWITH_QUICKTIME)
92 ENDIF(WITH_QUICKTIME)
93
94 IF(WITH_FFMPEG)
95         SET(INC ${INC} ${FFMPEG_INC})
96         ADD_DEFINITIONS(-DWITH_FFMPEG)
97 ENDIF(WITH_FFMPEG)
98
99 IF(WITH_LCMS)
100         SET(INC ${INC} ${LCMS_INCLUDE_DIR})
101         ADD_DEFINITIONS(-DWITH_LCMS)
102 ENDIF(WITH_LCMS)
103
104 IF(NOT WITH_ELBEEM)
105         ADD_DEFINITIONS(-DDISABLE_ELBEEM)
106 ENDIF(NOT WITH_ELBEEM)
107
108 IF(WITH_FFTW3)
109         ADD_DEFINITIONS(-DFFTW3=1)
110 ENDIF(WITH_FFTW3)
111
112 IF(WITH_SDL)
113         ADD_DEFINITIONS(-DWITH_SDL)
114 ENDIF(WITH_SDL)
115
116 IF(WITH_OPENAL)
117         ADD_DEFINITIONS(-DWITH_OPENAL)
118 ENDIF(WITH_OPENAL)
119
120 IF(WITH_JACK)
121         ADD_DEFINITIONS(-DWITH_JACK)
122 ENDIF(WITH_JACK)
123
124 # Build makesrna executable
125 ADD_EXECUTABLE(makesrna ${SRC} ${INC_FILES})
126 TARGET_LINK_LIBRARIES(makesrna bf_dna)
127
128 # Output rna_*_gen.c
129 # note (linux only): with crashes try add this after COMMAND: valgrind --leak-check=full --track-origins=yes
130 ADD_CUSTOM_COMMAND(
131         OUTPUT ${GENSRC}
132         COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesrna ${CMAKE_CURRENT_BINARY_DIR}/
133         DEPENDS makesrna
134 )
135
136 # Build bf_rna
137 SET(SRC rna_access.c ${GENSRC})
138 BLENDERLIB(bf_rna "${SRC}" "${INC}")
139
140 MESSAGE(STATUS "Configuring makesrna")