copy of docs from 2.4x for python modules that have been kept
[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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, 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(../../../../intern/guardedalloc .. ../../makesdna ../../blenkernel ../../blenlib ../../ikplugin ../../windowmanager ../../editors/include ../../imbuf ../../render/extern/include .)
43 FILE(GLOB INC_FILES ../*.h ../../makesdna/*.h)
44
45 IF(WITH_PYTHON)
46
47 ELSE(WITH_PYTHON)
48         ADD_DEFINITIONS(-DDISABLE_PYTHON)
49 ENDIF(WITH_PYTHON)
50
51 IF(WIN32)
52         SET(INC ${INC} ${PTHREADS_INC})
53 ENDIF(WIN32)
54
55 IF(WITH_GAMEENGINE)
56         ADD_DEFINITIONS(-DGAMEBLENDER)
57 ENDIF(WITH_GAMEENGINE)
58
59 IF(WITH_OPENEXR)
60         ADD_DEFINITIONS(-DWITH_OPENEXR)
61 ENDIF(WITH_OPENEXR)
62
63 IF(WITH_OPENJPEG)
64         ADD_DEFINITIONS(-DWITH_OPENJPEG)
65 ENDIF(WITH_OPENJPEG)
66
67 IF(WITH_DDS)
68         ADD_DEFINITIONS(-DWITH_DDS)
69 ENDIF(WITH_DDS)
70
71 IF(WITH_QUICKTIME)
72         SET(INC ${INC} ../../quicktime)
73         ADD_DEFINITIONS(-DWITH_QUICKTIME)
74 ENDIF(WITH_QUICKTIME)
75
76 IF(WITH_FFMPEG)
77         SET(INC ${INC} ${FFMPEG_INC})
78         ADD_DEFINITIONS(-DWITH_FFMPEG)
79 ENDIF(WITH_FFMPEG)
80
81 IF(NOT WITH_ELBEEM)
82         ADD_DEFINITIONS(-DDISABLE_ELBEEM)
83 ENDIF(NOT WITH_ELBEEM)
84
85 IF(WITH_FFTW3)
86         ADD_DEFINITIONS(-DFFTW3=1)
87 ENDIF(WITH_FFTW3)
88
89 IF(WITH_SDL)
90         ADD_DEFINITIONS(-DWITH_SDL)
91 ENDIF(WITH_SDL)
92
93 IF(WITH_OPENAL)
94         ADD_DEFINITIONS(-DWITH_OPENAL)
95 ENDIF(WITH_OPENAL)
96
97 IF(WITH_JACK)
98         ADD_DEFINITIONS(-DWITH_JACK)
99 ENDIF(WITH_JACK)
100
101 # Build makesrna executable
102 ADD_EXECUTABLE(makesrna ${SRC} ${INC_FILES})
103 TARGET_LINK_LIBRARIES(makesrna bf_dna)
104
105 # Output rna_*_gen.c
106 ADD_CUSTOM_COMMAND(
107         OUTPUT ${GENSRC}
108         # with crashes try add this after COMMAND: valgrind --leak-check=full --track-origins=yes 
109         COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesrna ${CMAKE_CURRENT_BINARY_DIR}/
110         DEPENDS makesrna
111 )
112
113 # Build bf_rna
114 SET(SRC rna_access.c ${GENSRC})
115 BLENDERLIB(bf_rna "${SRC}" "${INC}")
116
117 MESSAGE(STATUS "Configuring makesrna")
118