Fix crash from freeing of NULL pointer
[blender.git] / source / blender / imbuf / CMakeLists.txt
1 # ***** BEGIN GPL LICENSE BLOCK *****
2 #
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 #
17 # The Original Code is Copyright (C) 2006, Blender Foundation
18 # All rights reserved.
19 #
20 # The Original Code is: all of this file.
21 #
22 # Contributor(s): Jacques Beaurain.
23 #
24 # ***** END GPL LICENSE BLOCK *****
25
26 set(INC 
27         .
28         ../blenkernel
29         ../blenlib
30         ../blenloader
31         ../makesdna
32         ../makesrna
33         ../../../intern/guardedalloc
34         ../../../intern/memutil
35 )
36
37 set(INC_SYS
38         ${JPEG_INCLUDE_DIR}
39         ${PNG_INCLUDE_DIRS}
40         ${ZLIB_INCLUDE_DIRS}
41 )
42
43 set(SRC
44         intern/allocimbuf.c
45         intern/anim_movie.c
46         intern/bmp.c
47         intern/cache.c
48         intern/colormanagement.c
49         intern/colormanagement_inline.c
50         intern/divers.c
51         intern/filetype.c
52         intern/filter.c
53         intern/imageprocess.c
54         intern/indexer.c
55         intern/iris.c
56         intern/jpeg.c
57         intern/metadata.c
58         intern/module.c
59         intern/moviecache.c
60         intern/png.c
61         intern/readimage.c
62         intern/rectop.c
63         intern/rotate.c
64         intern/scaling.c
65         intern/stereoimbuf.c
66         intern/targa.c
67         intern/thumbs.c
68         intern/thumbs_blend.c
69         intern/thumbs_font.c
70         intern/util.c
71         intern/writeimage.c
72
73         IMB_colormanagement.h
74         IMB_imbuf.h
75         IMB_imbuf_types.h
76         IMB_moviecache.h
77         IMB_thumbs.h
78         intern/IMB_allocimbuf.h
79         intern/IMB_anim.h
80         intern/IMB_colormanagement_intern.h
81         intern/IMB_filetype.h
82         intern/IMB_filter.h
83         intern/IMB_indexer.h
84         intern/IMB_metadata.h
85         intern/imbuf.h
86         
87         # orphan include
88         ../../../intern/ffmpeg/ffmpeg_compat.h
89 )
90
91 if(WITH_IMAGE_OPENEXR)
92         add_definitions(-DWITH_OPENEXR)
93 else()
94         list(APPEND SRC
95                 intern/openexr/openexr_stub.cpp
96         )
97 endif()
98
99 if(WITH_IMAGE_TIFF)
100         list(APPEND INC_SYS
101                 ${TIFF_INCLUDE_DIR}
102         )
103         list(APPEND SRC
104                 intern/tiff.c
105         )
106
107         add_definitions(-DWITH_TIFF)
108 endif()
109
110
111 if(WITH_OPENIMAGEIO)
112         add_definitions(-DWITH_OPENIMAGEIO)
113 endif()
114
115 if(WITH_IMAGE_OPENJPEG)
116         list(APPEND INC_SYS
117                 ${OPENJPEG_INCLUDE_DIRS}
118         )
119         list(APPEND SRC
120                 intern/jp2.c
121         )
122
123         add_definitions(-DWITH_OPENJPEG ${OPENJPEG_DEFINES})
124 endif()
125
126 if(WITH_CODEC_AVI)
127         list(APPEND INC
128                 ../avi
129         )
130         add_definitions(-DWITH_AVI)
131 endif()
132
133 if(WITH_CODEC_QUICKTIME)
134         list(APPEND INC
135                 ../quicktime
136         )
137         list(APPEND INC_SYS
138                 ${QUICKTIME_INCLUDE_DIRS}
139         )
140         add_definitions(-DWITH_QUICKTIME)
141 endif()
142
143 if(WITH_CODEC_FFMPEG)
144         list(APPEND INC
145                 ../../../intern/ffmpeg
146         )
147         list(APPEND INC_SYS
148                 ${FFMPEG_INCLUDE_DIRS}
149         )
150         add_definitions(-DWITH_FFMPEG)
151
152         remove_strict_flags_file(
153                 intern/indexer.c
154                 intern/util.c
155                 intern/anim_movie.c
156         )
157 endif()
158
159 if(WITH_IMAGE_DDS)
160         add_definitions(-DWITH_DDS)
161 endif()
162
163 if(WITH_IMAGE_CINEON)
164         add_definitions(-DWITH_CINEON)
165 endif()
166
167 if(WITH_IMAGE_HDR)
168         list(APPEND SRC
169                 intern/radiance_hdr.c
170         )
171         add_definitions(-DWITH_HDR)
172 endif()
173
174 list(APPEND INC
175         ../../../intern/opencolorio
176 )
177
178 if(WIN32)
179         list(APPEND INC
180                 ../../../intern/utfconv
181         )
182 endif()
183
184 # no need to compile object files for inline headers.
185 set_source_files_properties(
186         intern/colormanagement_inline.c
187         PROPERTIES HEADER_FILE_ONLY TRUE
188 )
189
190 blender_add_lib(bf_imbuf "${SRC}" "${INC}" "${INC_SYS}")