| 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 25 matching lines...) Expand all Loading... |
| 36 list (APPEND private_includes ../third_party/etc1 ../third_party/ktx) | 36 list (APPEND private_includes ../third_party/etc1 ../third_party/ktx) |
| 37 | 37 |
| 38 function (remove_srcs) | 38 function (remove_srcs) |
| 39 file (GLOB_RECURSE to_remove ${ARGN}) | 39 file (GLOB_RECURSE to_remove ${ARGN}) |
| 40 list (REMOVE_ITEM srcs ${to_remove}) | 40 list (REMOVE_ITEM srcs ${to_remove}) |
| 41 set (srcs ${srcs} PARENT_SCOPE) | 41 set (srcs ${srcs} PARENT_SCOPE) |
| 42 endfunction() | 42 endfunction() |
| 43 | 43 |
| 44 # This file is empty and is only used to trick GYP. | 44 # This file is empty and is only used to trick GYP. |
| 45 remove_srcs (../src/core/SkForceCPlusPlusLinking.cpp) | 45 remove_srcs (../src/core/SkForceCPlusPlusLinking.cpp) |
| 46 # This file forces linking for all our supported image decoders. We're more fin
e-grained. | |
| 47 remove_srcs (../src/images/SkForceLinking.cpp) | |
| 48 # Chrome only? | 46 # Chrome only? |
| 49 remove_srcs (../src/ports/SkFontHost_fontconfig.cpp | 47 remove_srcs (../src/ports/SkFontHost_fontconfig.cpp |
| 50 ../src/fonts/SkFontMgr_fontconfig.cpp | 48 ../src/fonts/SkFontMgr_fontconfig.cpp |
| 51 ../src/ports/SkFontConfigInterface_direct.cpp | 49 ../src/ports/SkFontConfigInterface_direct.cpp |
| 52 ../src/ports/SkFontConfigInterface_direct_factory.cpp | 50 ../src/ports/SkFontConfigInterface_direct_factory.cpp |
| 53 ../src/ports/SkFontConfigInterface_direct_google3.cpp | 51 ../src/ports/SkFontConfigInterface_direct_google3.cpp |
| 54 ../src/ports/SkFontConfigInterface_direct_google3_factory.cpp) | 52 ../src/ports/SkFontConfigInterface_direct_google3_factory.cpp) |
| 55 # Alternative font managers. | 53 # Alternative font managers. |
| 56 remove_srcs (../src/ports/SkFontMgr_custom*.cpp) | 54 remove_srcs (../src/ports/SkFontMgr_custom*.cpp) |
| 57 | 55 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 if (EXPAT_FOUND) | 157 if (EXPAT_FOUND) |
| 160 list (APPEND private_includes ${EXPAT_INCLUDE_DIRS}) | 158 list (APPEND private_includes ${EXPAT_INCLUDE_DIRS}) |
| 161 list (APPEND libs ${EXPAT_LIBRARIES}) | 159 list (APPEND libs ${EXPAT_LIBRARIES}) |
| 162 else() | 160 else() |
| 163 remove_srcs (../src/ports/SkFontMgr_android_parser.cpp) | 161 remove_srcs (../src/ports/SkFontMgr_android_parser.cpp) |
| 164 endif() | 162 endif() |
| 165 | 163 |
| 166 if (GIF_FOUND) | 164 if (GIF_FOUND) |
| 167 list (APPEND private_includes ${GIF_INCLUDE_DIRS}) | 165 list (APPEND private_includes ${GIF_INCLUDE_DIRS}) |
| 168 list (APPEND libs ${GIF_LIBRARIES}) | 166 list (APPEND libs ${GIF_LIBRARIES}) |
| 169 add_definitions(-DSK_CODEC_DECODES_GIF) | 167 add_definitions(-DSK_HAS_GIF_LIBRARY) |
| 170 else() | 168 else() |
| 171 remove_srcs(../src/images/*GIF*) | 169 remove_srcs(../src/images/*GIF*) |
| 172 remove_srcs(../src/codec/*Gif*) | 170 remove_srcs(../src/codec/*Gif*) |
| 173 endif() | 171 endif() |
| 174 | 172 |
| 175 if (JPEG_FOUND) | 173 if (JPEG_FOUND) |
| 176 list (APPEND private_includes ${JPEG_INCLUDE_DIRS}) | 174 list (APPEND private_includes ${JPEG_INCLUDE_DIRS}) |
| 177 list (APPEND libs ${JPEG_LIBRARIES}) | 175 list (APPEND libs ${JPEG_LIBRARIES}) |
| 178 add_definitions(-DSK_CODEC_DECODES_JPEG) | 176 add_definitions(-DSK_HAS_JPEG_LIBRARY) |
| 179 else() | 177 else() |
| 180 remove_srcs(../src/images/*JPEG*) | 178 remove_srcs(../src/images/*JPEG*) |
| 181 remove_srcs(../src/codec/*Jpeg*) | 179 remove_srcs(../src/codec/*Jpeg*) |
| 182 endif() | 180 endif() |
| 183 | 181 |
| 184 if (LUA_FOUND) | 182 if (LUA_FOUND) |
| 185 list (APPEND private_includes ${LUA_INCLUDE_DIR}) | 183 list (APPEND private_includes ${LUA_INCLUDE_DIR}) |
| 186 list (APPEND libs ${LUA_LIBRARIES}) | 184 list (APPEND libs ${LUA_LIBRARIES}) |
| 187 else() | 185 else() |
| 188 remove_srcs(../src/utils/*Lua*) | 186 remove_srcs(../src/utils/*Lua*) |
| 189 endif() | 187 endif() |
| 190 | 188 |
| 191 if (PNG_FOUND) | 189 if (PNG_FOUND) |
| 192 list (APPEND private_includes ${PNG_INCLUDE_DIRS}) | 190 list (APPEND private_includes ${PNG_INCLUDE_DIRS}) |
| 193 list (APPEND libs ${PNG_LIBRARIES}) | 191 list (APPEND libs ${PNG_LIBRARIES}) |
| 194 add_definitions(-DPNG_SKIP_SETJMP_CHECK) | 192 add_definitions(-DPNG_SKIP_SETJMP_CHECK) |
| 195 add_definitions(-DPNG_SKIP_SKIA_OPTS) | 193 add_definitions(-DPNG_SKIP_SKIA_OPTS) |
| 196 add_definitions(-DSK_CODEC_DECODES_PNG) | 194 add_definitions(-DSK_HAS_PNG_LIBRARY) |
| 197 else() | 195 else() |
| 198 remove_srcs(../src/images/*PNG*) | 196 remove_srcs(../src/images/*PNG*) |
| 199 remove_srcs(../src/codec/*Png*) | 197 remove_srcs(../src/codec/*Png*) |
| 200 remove_srcs(../src/codec/*Ico*) | 198 remove_srcs(../src/codec/*Ico*) |
| 201 endif() | 199 endif() |
| 202 | 200 |
| 203 if (ZLIB_FOUND) | 201 if (ZLIB_FOUND) |
| 204 list (APPEND private_includes ${ZLIB_INCLUDE_DIRS}) | 202 list (APPEND private_includes ${ZLIB_INCLUDE_DIRS}) |
| 205 list (APPEND libs ${ZLIB_LIBRARIES}) | 203 list (APPEND libs ${ZLIB_LIBRARIES}) |
| 206 remove_srcs(../src/pdf/SkDocument_PDF_None.cpp) | 204 remove_srcs(../src/pdf/SkDocument_PDF_None.cpp) |
| 207 else() | 205 else() |
| 208 remove_srcs(../src/pdf/*.cpp) | 206 remove_srcs(../src/pdf/*.cpp) |
| 209 set (srcs ${srcs} ../src/pdf/SkDocument_PDF_None.cpp) | 207 set (srcs ${srcs} ../src/pdf/SkDocument_PDF_None.cpp) |
| 210 endif() | 208 endif() |
| 211 | 209 |
| 212 if (WEBP_INCLUDE_DIRS AND WEBP_LIBRARIES) | 210 if (WEBP_INCLUDE_DIRS AND WEBP_LIBRARIES) |
| 213 list (APPEND private_includes ${WEBP_INCLUDE_DIRS}) | 211 list (APPEND private_includes ${WEBP_INCLUDE_DIRS}) |
| 214 list (APPEND libs ${WEBP_LIBRARIES}) | 212 list (APPEND libs ${WEBP_LIBRARIES}) |
| 215 add_definitions(-DSK_CODEC_DECODES_WEBP) | 213 add_definitions(-DSK_HAS_WEBP_LIBRARY) |
| 216 else() | 214 else() |
| 217 remove_srcs(../src/images/*WEBP*) | 215 remove_srcs(../src/images/*WEBP*) |
| 218 remove_srcs(../src/codec/*Webp*) | 216 remove_srcs(../src/codec/*Webp*) |
| 219 endif() | 217 endif() |
| 220 | 218 |
| 221 if (FREETYPE_FOUND) | 219 if (FREETYPE_FOUND) |
| 222 list (APPEND private_includes ${FREETYPE_INCLUDE_DIRS}) | 220 list (APPEND private_includes ${FREETYPE_INCLUDE_DIRS}) |
| 223 list (APPEND libs ${FREETYPE_LIBRARIES}) | 221 list (APPEND libs ${FREETYPE_LIBRARIES}) |
| 224 endif() | 222 endif() |
| 225 | 223 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n") | 329 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n") |
| 332 endif () | 330 endif () |
| 333 endforeach() | 331 endforeach() |
| 334 endif() | 332 endif() |
| 335 endforeach() | 333 endforeach() |
| 336 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n") | 334 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n") |
| 337 | 335 |
| 338 # Now build a simple example app that uses Skia via libskia.so. | 336 # Now build a simple example app that uses Skia via libskia.so. |
| 339 add_executable(example example.cpp) | 337 add_executable(example example.cpp) |
| 340 target_link_libraries(example skia ${OPENGL_LIBRARIES}) | 338 target_link_libraries(example skia ${OPENGL_LIBRARIES}) |
| OLD | NEW |