CMake: add libs needed for gtests
[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 # ***** END GPL LICENSE BLOCK *****
20
21 set(INC
22         .
23         ../blenkernel
24         ../blenlib
25         ../blenloader
26         ../makesdna
27         ../makesrna
28         ../../../intern/guardedalloc
29         ../../../intern/memutil
30 )
31
32 set(INC_SYS
33         ${JPEG_INCLUDE_DIR}
34         ${PNG_INCLUDE_DIRS}
35         ${ZLIB_INCLUDE_DIRS}
36 )
37
38 set(SRC
39         intern/allocimbuf.c
40         intern/anim_movie.c
41         intern/bmp.c
42         intern/cache.c
43         intern/colormanagement.c
44         intern/colormanagement_inline.c
45         intern/divers.c
46         intern/filetype.c
47         intern/filter.c
48         intern/imageprocess.c
49         intern/indexer.c
50         intern/iris.c
51         intern/jpeg.c
52         intern/metadata.c
53         intern/module.c
54         intern/moviecache.c
55         intern/png.c
56         intern/readimage.c
57         intern/rectop.c
58         intern/rotate.c
59         intern/scaling.c
60         intern/stereoimbuf.c
61         intern/targa.c
62         intern/thumbs.c
63         intern/thumbs_blend.c
64         intern/thumbs_font.c
65         intern/util.c
66         intern/writeimage.c
67
68         IMB_colormanagement.h
69         IMB_imbuf.h
70         IMB_imbuf_types.h
71         IMB_metadata.h
72         IMB_moviecache.h
73         IMB_thumbs.h
74         intern/IMB_allocimbuf.h
75         intern/IMB_anim.h
76         intern/IMB_colormanagement_intern.h
77         intern/IMB_filetype.h
78         intern/IMB_filter.h
79         intern/IMB_indexer.h
80         intern/imbuf.h
81
82         # orphan include
83         ../../../intern/ffmpeg/ffmpeg_compat.h
84 )
85
86 set(LIB
87         bf_blenkernel
88         bf_blenlib
89         bf_blenloader
90         bf_intern_guardedalloc
91         bf_intern_memutil
92         bf_intern_opencolorio
93 )
94
95 if(WITH_IMAGE_OPENEXR)
96         list(APPEND LIB
97                 bf_imbuf_openexr
98         )
99         add_definitions(-DWITH_OPENEXR)
100 else()
101         list(APPEND SRC
102                 intern/openexr/openexr_stub.cpp
103         )
104 endif()
105
106 if(WITH_IMAGE_TIFF)
107         list(APPEND INC_SYS
108                 ${TIFF_INCLUDE_DIR}
109         )
110         list(APPEND SRC
111                 intern/tiff.c
112         )
113         add_definitions(-DWITH_TIFF)
114 endif()
115
116
117 if(WITH_OPENIMAGEIO)
118         list(APPEND LIB
119                 bf_imbuf_openimageio
120         )
121         add_definitions(-DWITH_OPENIMAGEIO)
122 endif()
123
124 if(WITH_IMAGE_OPENJPEG)
125         list(APPEND INC_SYS
126                 ${OPENJPEG_INCLUDE_DIRS}
127         )
128         list(APPEND SRC
129                 intern/jp2.c
130         )
131
132         add_definitions(-DWITH_OPENJPEG ${OPENJPEG_DEFINES})
133 endif()
134
135 if(WITH_CODEC_AVI)
136         list(APPEND INC
137                 ../avi
138         )
139         list(APPEND LIB
140                 bf_avi
141         )
142         add_definitions(-DWITH_AVI)
143 endif()
144
145 if(WITH_CODEC_FFMPEG)
146         list(APPEND INC
147                 ../../../intern/ffmpeg
148         )
149         list(APPEND INC_SYS
150                 ${FFMPEG_INCLUDE_DIRS}
151         )
152         add_definitions(-DWITH_FFMPEG)
153
154         remove_strict_c_flags_file(
155                 intern/anim_movie.c
156                 intern/indexer.c
157                 intern/util.c
158         )
159 endif()
160
161 if(WITH_IMAGE_DDS)
162         list(APPEND LIB
163                 bf_imbuf_dds
164         )
165         add_definitions(-DWITH_DDS)
166 endif()
167
168 if(WITH_IMAGE_CINEON)
169         list(APPEND LIB
170                 bf_imbuf_cineon
171         )
172         add_definitions(-DWITH_CINEON)
173 endif()
174
175 if(WITH_IMAGE_HDR)
176         list(APPEND SRC
177                 intern/radiance_hdr.c
178         )
179         add_definitions(-DWITH_HDR)
180 endif()
181
182 list(APPEND INC
183         ../../../intern/opencolorio
184 )
185
186 if(WIN32)
187         list(APPEND INC
188                 ../../../intern/utfconv
189         )
190 endif()
191
192 # no need to compile object files for inline headers.
193 set_source_files_properties(
194         intern/colormanagement_inline.c
195         PROPERTIES HEADER_FILE_ONLY TRUE
196 )
197
198 blender_add_lib(bf_imbuf "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")