RNA
[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 LIST(REMOVE_ITEM DEFSRC rna_access.c rna_define.c makesrna.c)
29 FILE(GLOB_RECURSE APISRC "../../editors/*/*_api.c")
30  
31 STRING(REGEX REPLACE "rna_([a-zA-Z0-9_-]*).c" "${CMAKE_CURRENT_BINARY_DIR}/rna_\\1_gen.c" GENSRC "${DEFSRC}")
32
33 SET(SRC
34      makesrna.c
35      rna_define.c
36      ${DEFSRC}
37      ${APISRC}
38      ../../../../intern/guardedalloc/intern/mallocn.c
39      ../../../../intern/guardedalloc/intern/mmap_win.c)
40
41 INCLUDE_DIRECTORIES(../../../../intern/guardedalloc .. ../../makesdna ../../blenkernel ../../blenlib ../../windowmanager ../../editors/include ../../imbuf .)
42 FILE(GLOB INC_FILES ../*.h ../../makesdna/*.h)
43
44 IF(WITH_OPENEXR)
45   ADD_DEFINITIONS(-DWITH_OPENEXR)
46 ENDIF(WITH_OPENEXR)
47
48 IF(WITH_OPENJPEG)
49   ADD_DEFINITIONS(-DWITH_OPENJPEG)
50 ENDIF(WITH_OPENJPEG)
51
52 IF(WITH_DDS)
53   ADD_DEFINITIONS(-DWITH_DDS)
54 ENDIF(WITH_DDS)
55
56 IF(WITH_QUICKTIME)
57   ADD_DEFINITIONS(-DWITH_QUICKTIME)
58 ENDIF(WITH_QUICKTIME)
59
60 IF(WITH_FFMPEG)
61   ADD_DEFINITIONS(-DWITH_FFMPEG)
62 ENDIF(WITH_FFMPEG)
63
64 # Build makesrna executable
65 ADD_EXECUTABLE(makesrna ${SRC} ${INC_FILES})
66 TARGET_LINK_LIBRARIES(makesrna bf_dna)
67
68 # Output rna_*_gen.c
69 ADD_CUSTOM_COMMAND(
70   OUTPUT ${GENSRC}
71   COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesrna ${CMAKE_CURRENT_BINARY_DIR}/
72   DEPENDS makesrna
73 )
74
75 # Build bf_rna
76 SET(SRC rna_access.c ${GENSRC})
77 BLENDERLIB(bf_rna "${SRC}" "${INC}")
78
79 MESSAGE(STATUS "Configuring makesrna")
80