| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 if (WIN32) | 107 if (WIN32) |
| 108 if(SKIA_GDI) | 108 if(SKIA_GDI) |
| 109 remove_srcs(../src/ports/SkFontMgr_win_dw_factory.cpp) | 109 remove_srcs(../src/ports/SkFontMgr_win_dw_factory.cpp) |
| 110 else() | 110 else() |
| 111 remove_srcs(../src/ports/SkFontMgr_win_gdi_factory.cpp) | 111 remove_srcs(../src/ports/SkFontMgr_win_gdi_factory.cpp) |
| 112 endif() | 112 endif() |
| 113 endif() | 113 endif() |
| 114 | 114 |
| 115 remove_srcs(../src/gpu/gl/angle/*) # TODO | 115 remove_srcs(../src/gpu/gl/angle/*) # TODO |
| 116 remove_srcs(../src/codec/* ../src/android/*) # TODO: Requires Chromium's libjpe
g-turbo, and incompatible giflib. | 116 remove_srcs(../src/android/*) |
| 117 |
| 118 remove_srcs(../src/codec/*Raw*.cpp) |
| 117 | 119 |
| 118 # Certain files must be compiled with support for SSSE3, SSE4.1, AVX, or AVX2 in
trinsics. | 120 # Certain files must be compiled with support for SSSE3, SSE4.1, AVX, or AVX2 in
trinsics. |
| 119 file (GLOB_RECURSE ssse3_srcs ../src/*ssse3*.cpp ../src/*SSSE3*.cpp) | 121 file (GLOB_RECURSE ssse3_srcs ../src/*ssse3*.cpp ../src/*SSSE3*.cpp) |
| 120 file (GLOB_RECURSE sse41_srcs ../src/*sse4*.cpp ../src/*SSE4*.cpp) | 122 file (GLOB_RECURSE sse41_srcs ../src/*sse4*.cpp ../src/*SSE4*.cpp) |
| 121 file (GLOB_RECURSE avx_srcs ../src/*_avx.cpp) | 123 file (GLOB_RECURSE avx_srcs ../src/*_avx.cpp) |
| 122 file (GLOB_RECURSE avx2_srcs ../src/*_avx2.cpp) | 124 file (GLOB_RECURSE avx2_srcs ../src/*_avx2.cpp) |
| 123 set_source_files_properties(${ssse3_srcs} PROPERTIES COMPILE_FLAGS -mssse3) | 125 set_source_files_properties(${ssse3_srcs} PROPERTIES COMPILE_FLAGS -mssse3) |
| 124 set_source_files_properties(${sse41_srcs} PROPERTIES COMPILE_FLAGS -msse4.1) | 126 set_source_files_properties(${sse41_srcs} PROPERTIES COMPILE_FLAGS -msse4.1) |
| 125 set_source_files_properties(${avx_srcs} PROPERTIES COMPILE_FLAGS -mavx) | 127 set_source_files_properties(${avx_srcs} PROPERTIES COMPILE_FLAGS -mavx) |
| 126 set_source_files_properties(${avx2_srcs} PROPERTIES COMPILE_FLAGS -mavx2) | 128 set_source_files_properties(${avx2_srcs} PROPERTIES COMPILE_FLAGS -mavx2) |
| 127 | 129 |
| 128 # Detect our optional dependencies. | 130 # Detect our optional dependencies. |
| 129 # If we can't find them, don't build the parts of Skia that use them. | 131 # If we can't find them, don't build the parts of Skia that use them. |
| 130 find_package (EXPAT) | 132 find_package (EXPAT) |
| 133 find_package (GIF) |
| 134 find_package (JPEG) |
| 131 find_package (Lua) | 135 find_package (Lua) |
| 136 find_package (PNG) |
| 132 find_package (ZLIB) | 137 find_package (ZLIB) |
| 133 # No find_package for libwebp as far as I can tell, so simulate it here. | 138 # No find_package for libwebp as far as I can tell, so simulate it here. |
| 134 find_path (WEBP_INCLUDE_DIRS "webp/decode.h") | 139 find_path (WEBP_INCLUDE_DIRS "webp/decode.h") |
| 135 find_library (WEBP_LIBRARIES webp) | 140 find_library (WEBP_LIBRARIES webp) |
| 136 find_path (OSMESA_INCLUDE_DIRS "GL/osmesa.h") | 141 find_path (OSMESA_INCLUDE_DIRS "GL/osmesa.h") |
| 137 find_library(OSMESA_LIBRARIES "OSMesa") | 142 find_library(OSMESA_LIBRARIES "OSMesa") |
| 138 | 143 |
| 139 if (UNIX AND NOT APPLE) | 144 if (UNIX AND NOT APPLE) |
| 140 find_package (Freetype) | 145 find_package (Freetype) |
| 141 # Same deal for fontconfig. | 146 # Same deal for fontconfig. |
| 142 find_path (FONTCONFIG_INCLUDE_DIRS "fontconfig/fontconfig.h") | 147 find_path (FONTCONFIG_INCLUDE_DIRS "fontconfig/fontconfig.h") |
| 143 find_library (FONTCONFIG_LIBRARIES fontconfig) | 148 find_library (FONTCONFIG_LIBRARIES fontconfig) |
| 144 find_package (GIF) | |
| 145 find_package (JPEG) | |
| 146 find_package (PNG) | |
| 147 endif() | 149 endif() |
| 148 | 150 |
| 149 # TODO: macro away this if (found) ... else() ... endif() stuff. | 151 # TODO: macro away this if (found) ... else() ... endif() stuff. |
| 150 | 152 |
| 151 if (EXPAT_FOUND) | 153 if (EXPAT_FOUND) |
| 152 list (APPEND private_includes ${EXPAT_INCLUDE_DIRS}) | 154 list (APPEND private_includes ${EXPAT_INCLUDE_DIRS}) |
| 153 list (APPEND libs ${EXPAT_LIBRARIES}) | 155 list (APPEND libs ${EXPAT_LIBRARIES}) |
| 154 else() | 156 else() |
| 155 remove_srcs (../src/ports/SkFontMgr_android_parser.cpp) | 157 remove_srcs (../src/ports/SkFontMgr_android_parser.cpp) |
| 156 endif() | 158 endif() |
| 157 | 159 |
| 158 if (GIF_FOUND) | 160 if (GIF_FOUND) |
| 159 list (APPEND private_includes ${GIF_INCLUDE_DIRS}) | 161 list (APPEND private_includes ${GIF_INCLUDE_DIRS}) |
| 160 list (APPEND libs ${GIF_LIBRARIES}) | 162 list (APPEND libs ${GIF_LIBRARIES}) |
| 161 else() | 163 else() |
| 164 remove_srcs(../src/codec/*Gif*.cpp) |
| 162 remove_srcs(../src/images/*gif*) | 165 remove_srcs(../src/images/*gif*) |
| 163 endif() | 166 endif() |
| 164 | 167 |
| 165 if (JPEG_FOUND) | 168 if (JPEG_FOUND) |
| 166 list (APPEND private_includes ${JPEG_INCLUDE_DIRS}) | 169 list (APPEND private_includes ${JPEG_INCLUDE_DIRS}) |
| 167 list (APPEND libs ${JPEG_LIBRARIES}) | 170 list (APPEND libs ${JPEG_LIBRARIES}) |
| 168 else() | 171 else() |
| 172 remove_srcs(../src/codec/*Jpeg*.cpp) |
| 173 remove_srcs(../src/codec/*Raw*.cpp) |
| 169 remove_srcs(../src/images/*jpeg*) | 174 remove_srcs(../src/images/*jpeg*) |
| 170 endif() | 175 endif() |
| 171 | 176 |
| 172 if (LUA_FOUND) | 177 if (LUA_FOUND) |
| 173 list (APPEND private_includes ${LUA_INCLUDE_DIR}) | 178 list (APPEND private_includes ${LUA_INCLUDE_DIR}) |
| 174 list (APPEND libs ${LUA_LIBRARIES}) | 179 list (APPEND libs ${LUA_LIBRARIES}) |
| 175 else() | 180 else() |
| 176 remove_srcs(../src/utils/*Lua*) | 181 remove_srcs(../src/utils/*Lua*) |
| 177 endif() | 182 endif() |
| 178 | 183 |
| 179 if (PNG_FOUND) | 184 if (PNG_FOUND) |
| 180 list (APPEND private_includes ${PNG_INCLUDE_DIRS}) | 185 list (APPEND private_includes ${PNG_INCLUDE_DIRS}) |
| 181 list (APPEND libs ${PNG_LIBRARIES}) | 186 list (APPEND libs ${PNG_LIBRARIES}) |
| 182 else() | 187 else() |
| 188 remove_srcs(../src/codec/*Png*.cpp) |
| 189 remove_srcs(../src/codec/*Ico*.cpp) |
| 183 remove_srcs(../src/images/*png*) | 190 remove_srcs(../src/images/*png*) |
| 184 endif() | 191 endif() |
| 185 | 192 |
| 186 if (ZLIB_FOUND) | 193 if (ZLIB_FOUND) |
| 187 list (APPEND private_includes ${ZLIB_INCLUDE_DIRS}) | 194 list (APPEND private_includes ${ZLIB_INCLUDE_DIRS}) |
| 188 list (APPEND libs ${ZLIB_LIBRARIES}) | 195 list (APPEND libs ${ZLIB_LIBRARIES}) |
| 189 remove_srcs(../src/doc/SkDocument_PDF_None.cpp) | 196 remove_srcs(../src/doc/SkDocument_PDF_None.cpp) |
| 190 else() | 197 else() |
| 191 remove_srcs(../src/pdf/*.cpp ../src/doc/SkDocument_PDF.cpp) | 198 remove_srcs(../src/pdf/*.cpp ../src/doc/SkDocument_PDF.cpp) |
| 192 endif() | 199 endif() |
| 193 | 200 |
| 194 if (WEBP_INCLUDE_DIRS AND WEBP_LIBRARIES) | 201 if (WEBP_INCLUDE_DIRS AND WEBP_LIBRARIES) |
| 195 list (APPEND private_includes ${WEBP_INCLUDE_DIRS}) | 202 list (APPEND private_includes ${WEBP_INCLUDE_DIRS}) |
| 196 list (APPEND libs ${WEBP_LIBRARIES}) | 203 list (APPEND libs ${WEBP_LIBRARIES}) |
| 197 else() | 204 else() |
| 205 remove_srcs(../src/codec/*Webp*.cpp) |
| 198 remove_srcs(../src/images/*webp*) | 206 remove_srcs(../src/images/*webp*) |
| 199 endif() | 207 endif() |
| 200 | 208 |
| 201 if (FREETYPE_FOUND) | 209 if (FREETYPE_FOUND) |
| 202 list (APPEND private_includes ${FREETYPE_INCLUDE_DIRS}) | 210 list (APPEND private_includes ${FREETYPE_INCLUDE_DIRS}) |
| 203 list (APPEND libs ${FREETYPE_LIBRARIES}) | 211 list (APPEND libs ${FREETYPE_LIBRARIES}) |
| 204 endif() | 212 endif() |
| 205 | 213 |
| 206 if (FONTCONFIG_INCLUDE_DIRS AND FONTCONFIG_LIBRARIES) | 214 if (FONTCONFIG_INCLUDE_DIRS AND FONTCONFIG_LIBRARIES) |
| 207 list (APPEND private_includes ${FONTCONFIG_INCLUDE_DIRS}) | 215 list (APPEND private_includes ${FONTCONFIG_INCLUDE_DIRS}) |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n") | 314 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n") |
| 307 endif () | 315 endif () |
| 308 endforeach() | 316 endforeach() |
| 309 endif() | 317 endif() |
| 310 endforeach() | 318 endforeach() |
| 311 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n") | 319 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n") |
| 312 | 320 |
| 313 # Now build a simple example app that uses Skia via libskia.so. | 321 # Now build a simple example app that uses Skia via libskia.so. |
| 314 add_executable(example example.cpp) | 322 add_executable(example example.cpp) |
| 315 target_link_libraries(example skia ${OPENGL_LIBRARIES}) | 323 target_link_libraries(example skia ${OPENGL_LIBRARIES}) |
| OLD | NEW |