OLD | NEW |
---|---|
1 # Boilerplate. | 1 # Boilerplate. |
2 cmake_minimum_required (VERSION 3.1) # First version with CMAKE_CXX_STANDARD. | 2 cmake_minimum_required (VERSION 3.1) # First version with CMAKE_CXX_STANDARD. |
3 project (skimake) | 3 project (skimake) |
4 set (CMAKE_CXX_STANDARD 11) | 4 set (CMAKE_CXX_STANDARD 11) |
5 | 5 |
6 # Default to Release mode. We're mainly targeting Skia users, not Skia develope rs. | 6 # Default to Release mode. We're mainly targeting Skia users, not Skia develope rs. |
7 if (NOT CMAKE_BUILD_TYPE) | 7 if (NOT CMAKE_BUILD_TYPE) |
8 set (CMAKE_BUILD_TYPE Release) | 8 set (CMAKE_BUILD_TYPE Release) |
9 endif () | 9 endif () |
10 | 10 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 if (UNIX AND NOT APPLE) | 138 if (UNIX AND NOT APPLE) |
139 find_package (Freetype) | 139 find_package (Freetype) |
140 # Same deal for fontconfig. | 140 # Same deal for fontconfig. |
141 find_path (FONTCONFIG_INCLUDE_DIRS "fontconfig/fontconfig.h") | 141 find_path (FONTCONFIG_INCLUDE_DIRS "fontconfig/fontconfig.h") |
142 find_library (FONTCONFIG_LIBRARIES fontconfig) | 142 find_library (FONTCONFIG_LIBRARIES fontconfig) |
143 find_package (GIF) | 143 find_package (GIF) |
144 find_package (JPEG) | 144 find_package (JPEG) |
145 find_package (PNG) | 145 find_package (PNG) |
146 endif() | 146 endif() |
147 | 147 |
148 # Decide whether to turn on SkCodec. | 148 # We can always turn on BMP and WBMP codecs. They don't requires any dependenci es. |
mtklein
2016/02/16 23:08:59
Probably no need to guard these with defines then?
msarett
2016/02/17 14:34:54
You're right. Removing these defines.
| |
149 # TODO (skbug.com/4956): We should be able to turn specific codecs on and off ra ther than | 149 add_definitions(-DSK_CODEC_DECODES_BMP) |
150 # disabling all of them if one library is missing. | 150 add_definitions(-DSK_CODEC_DECODES_WBMP) |
151 if (NOT (GIF_FOUND AND JPEG_FOUND AND PNG_FOUND AND WEBP_INCLUDE_DIRS AND WEBP_L IBRARIES)) | |
152 remove_srcs(../src/codec/* ../src/android/*) | |
153 endif() | |
154 | 151 |
155 # Do not compile SkRawCodec. | 152 # Do not compile SkRawCodec. |
156 remove_srcs(../src/codec/*Raw*.cpp) | 153 remove_srcs(../src/codec/*Raw*.cpp) |
157 | 154 |
158 # TODO: macro away this if (found) ... else() ... endif() stuff. | 155 # TODO: macro away this if (found) ... else() ... endif() stuff. |
159 | 156 |
160 if (EXPAT_FOUND) | 157 if (EXPAT_FOUND) |
161 list (APPEND private_includes ${EXPAT_INCLUDE_DIRS}) | 158 list (APPEND private_includes ${EXPAT_INCLUDE_DIRS}) |
162 list (APPEND libs ${EXPAT_LIBRARIES}) | 159 list (APPEND libs ${EXPAT_LIBRARIES}) |
163 else() | 160 else() |
164 remove_srcs (../src/ports/SkFontMgr_android_parser.cpp) | 161 remove_srcs (../src/ports/SkFontMgr_android_parser.cpp) |
165 endif() | 162 endif() |
166 | 163 |
167 if (GIF_FOUND) | 164 if (GIF_FOUND) |
168 list (APPEND private_includes ${GIF_INCLUDE_DIRS}) | 165 list (APPEND private_includes ${GIF_INCLUDE_DIRS}) |
169 list (APPEND libs ${GIF_LIBRARIES}) | 166 list (APPEND libs ${GIF_LIBRARIES}) |
167 add_definitions(-DSK_CODEC_DECODES_GIF) | |
170 else() | 168 else() |
171 remove_srcs(../src/images/*gif*) | 169 remove_srcs(../src/images/*gif*) |
170 remove_srcs(../src/codec/*Gif*) | |
172 endif() | 171 endif() |
173 | 172 |
174 if (JPEG_FOUND) | 173 if (JPEG_FOUND) |
175 list (APPEND private_includes ${JPEG_INCLUDE_DIRS}) | 174 list (APPEND private_includes ${JPEG_INCLUDE_DIRS}) |
176 list (APPEND libs ${JPEG_LIBRARIES}) | 175 list (APPEND libs ${JPEG_LIBRARIES}) |
176 add_definitions(-DSK_CODEC_DECODES_JPEG) | |
177 else() | 177 else() |
178 remove_srcs(../src/images/*jpeg*) | 178 remove_srcs(../src/images/*jpeg*) |
179 remove_srcs(../src/images/*Jpeg*) | |
180 remove_srcs(../src/codec/*Jpeg*) | |
179 endif() | 181 endif() |
180 | 182 |
181 if (LUA_FOUND) | 183 if (LUA_FOUND) |
182 list (APPEND private_includes ${LUA_INCLUDE_DIR}) | 184 list (APPEND private_includes ${LUA_INCLUDE_DIR}) |
183 list (APPEND libs ${LUA_LIBRARIES}) | 185 list (APPEND libs ${LUA_LIBRARIES}) |
184 else() | 186 else() |
185 remove_srcs(../src/utils/*Lua*) | 187 remove_srcs(../src/utils/*Lua*) |
186 endif() | 188 endif() |
187 | 189 |
188 if (PNG_FOUND) | 190 if (PNG_FOUND) |
189 list (APPEND private_includes ${PNG_INCLUDE_DIRS}) | 191 list (APPEND private_includes ${PNG_INCLUDE_DIRS}) |
190 list (APPEND libs ${PNG_LIBRARIES}) | 192 list (APPEND libs ${PNG_LIBRARIES}) |
191 add_definitions(-DPNG_SKIP_SETJMP_CHECK) | 193 add_definitions(-DPNG_SKIP_SETJMP_CHECK) |
192 add_definitions(-DPNG_SKIP_SKIA_OPTS) | 194 add_definitions(-DPNG_SKIP_SKIA_OPTS) |
195 add_definitions(-DSK_CODEC_DECODES_PNG) | |
196 add_definitions(-DSK_CODEC_DECODES_ICO) | |
193 else() | 197 else() |
194 remove_srcs(../src/images/*png*) | 198 remove_srcs(../src/images/*png*) |
199 remove_srcs(../src/images/*ico*) | |
200 remove_srcs(../src/codec/*Png*) | |
201 remove_srcs(../src/codec/*Ico*) | |
195 endif() | 202 endif() |
196 | 203 |
197 if (ZLIB_FOUND) | 204 if (ZLIB_FOUND) |
198 list (APPEND private_includes ${ZLIB_INCLUDE_DIRS}) | 205 list (APPEND private_includes ${ZLIB_INCLUDE_DIRS}) |
199 list (APPEND libs ${ZLIB_LIBRARIES}) | 206 list (APPEND libs ${ZLIB_LIBRARIES}) |
200 remove_srcs(../src/doc/SkDocument_PDF_None.cpp) | 207 remove_srcs(../src/doc/SkDocument_PDF_None.cpp) |
201 else() | 208 else() |
202 remove_srcs(../src/pdf/*.cpp ../src/doc/SkDocument_PDF.cpp) | 209 remove_srcs(../src/pdf/*.cpp ../src/doc/SkDocument_PDF.cpp) |
203 endif() | 210 endif() |
204 | 211 |
205 if (WEBP_INCLUDE_DIRS AND WEBP_LIBRARIES) | 212 if (WEBP_INCLUDE_DIRS AND WEBP_LIBRARIES) |
206 list (APPEND private_includes ${WEBP_INCLUDE_DIRS}) | 213 list (APPEND private_includes ${WEBP_INCLUDE_DIRS}) |
207 list (APPEND libs ${WEBP_LIBRARIES}) | 214 list (APPEND libs ${WEBP_LIBRARIES}) |
215 add_definitions(-DSK_CODEC_DECODES_WEBP) | |
208 else() | 216 else() |
209 remove_srcs(../src/images/*webp*) | 217 remove_srcs(../src/images/*webp*) |
218 remove_srcs(../src/codec/*Webp*) | |
210 endif() | 219 endif() |
211 | 220 |
212 if (FREETYPE_FOUND) | 221 if (FREETYPE_FOUND) |
213 list (APPEND private_includes ${FREETYPE_INCLUDE_DIRS}) | 222 list (APPEND private_includes ${FREETYPE_INCLUDE_DIRS}) |
214 list (APPEND libs ${FREETYPE_LIBRARIES}) | 223 list (APPEND libs ${FREETYPE_LIBRARIES}) |
215 endif() | 224 endif() |
216 | 225 |
217 if (FONTCONFIG_INCLUDE_DIRS AND FONTCONFIG_LIBRARIES) | 226 if (FONTCONFIG_INCLUDE_DIRS AND FONTCONFIG_LIBRARIES) |
218 list (APPEND private_includes ${FONTCONFIG_INCLUDE_DIRS}) | 227 list (APPEND private_includes ${FONTCONFIG_INCLUDE_DIRS}) |
219 list (APPEND libs ${FONTCONFIG_LIBRARIES}) | 228 list (APPEND libs ${FONTCONFIG_LIBRARIES}) |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
317 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n") | 326 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n") |
318 endif () | 327 endif () |
319 endforeach() | 328 endforeach() |
320 endif() | 329 endif() |
321 endforeach() | 330 endforeach() |
322 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n") | 331 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n") |
323 | 332 |
324 # Now build a simple example app that uses Skia via libskia.so. | 333 # Now build a simple example app that uses Skia via libskia.so. |
325 add_executable(example example.cpp) | 334 add_executable(example example.cpp) |
326 target_link_libraries(example skia ${OPENGL_LIBRARIES}) | 335 target_link_libraries(example skia ${OPENGL_LIBRARIES}) |
OLD | NEW |