| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 set_source_files_properties(${sse42_srcs} PROPERTIES COMPILE_FLAGS -msse4.2) | 140 set_source_files_properties(${sse42_srcs} PROPERTIES COMPILE_FLAGS -msse4.2) |
| 141 set_source_files_properties(${avx_srcs} PROPERTIES COMPILE_FLAGS -mavx) | 141 set_source_files_properties(${avx_srcs} PROPERTIES COMPILE_FLAGS -mavx) |
| 142 set_source_files_properties(${avx2_srcs} PROPERTIES COMPILE_FLAGS -mavx2) | 142 set_source_files_properties(${avx2_srcs} PROPERTIES COMPILE_FLAGS -mavx2) |
| 143 endif() | 143 endif() |
| 144 | 144 |
| 145 # Detect our optional dependencies. | 145 # Detect our optional dependencies. |
| 146 # If we can't find them, don't build the parts of Skia that use them. | 146 # If we can't find them, don't build the parts of Skia that use them. |
| 147 find_package (EXPAT) | 147 find_package (EXPAT) |
| 148 find_package (Lua) | 148 find_package (Lua) |
| 149 find_package (ZLIB) | 149 find_package (ZLIB) |
| 150 # No find_package for libwebp as far as I can tell, so simulate it here. | 150 |
| 151 # For libraries that don't have find_package() scripts, we do it ourselves: |
| 151 find_path (WEBP_INCLUDE_DIRS "webp/decode.h") | 152 find_path (WEBP_INCLUDE_DIRS "webp/decode.h") |
| 152 find_library (WEBP_LIBRARIES webp) | 153 find_library (WEBP_LIBRARIES "webp") |
| 154 |
| 153 find_path (OSMESA_INCLUDE_DIRS "GL/osmesa.h") | 155 find_path (OSMESA_INCLUDE_DIRS "GL/osmesa.h") |
| 154 find_library(OSMESA_LIBRARIES "OSMesa") | 156 find_library(OSMESA_LIBRARIES "OSMesa") |
| 155 | 157 |
| 156 if (UNIX AND NOT APPLE) | 158 if (UNIX AND NOT APPLE) |
| 157 find_package (Freetype) | 159 find_package (Freetype) |
| 158 # Same deal for fontconfig. | 160 find_package (GIF) |
| 161 |
| 159 find_path (FONTCONFIG_INCLUDE_DIRS "fontconfig/fontconfig.h") | 162 find_path (FONTCONFIG_INCLUDE_DIRS "fontconfig/fontconfig.h") |
| 160 find_library (FONTCONFIG_LIBRARIES fontconfig) | 163 find_library (FONTCONFIG_LIBRARIES fontconfig) |
| 161 find_package (GIF) | 164 |
| 162 find_package (JPEG) | 165 # We require libjpeg-turbo >= 1.5.0. |
| 166 find_package(PkgConfig) |
| 167 pkg_check_modules(JPEG_TURBO libjpeg>=1.5.0) |
| 163 endif() | 168 endif() |
| 164 | 169 |
| 165 # Do not compile SkRawCodec. | 170 # Do not compile SkRawCodec. |
| 166 remove_srcs(../src/codec/*Raw*.cpp) | 171 remove_srcs(../src/codec/*Raw*.cpp) |
| 167 | 172 |
| 168 # TODO: macro away this if (found) ... else() ... endif() stuff. | 173 # TODO: macro away this if (found) ... else() ... endif() stuff. |
| 169 | 174 |
| 170 if (EXPAT_FOUND) | 175 if (EXPAT_FOUND) |
| 171 list (APPEND private_includes ${EXPAT_INCLUDE_DIRS}) | 176 list (APPEND private_includes ${EXPAT_INCLUDE_DIRS}) |
| 172 list (APPEND libs ${EXPAT_LIBRARIES}) | 177 list (APPEND libs ${EXPAT_LIBRARIES}) |
| 173 else() | 178 else() |
| 174 remove_srcs (../src/ports/SkFontMgr_android_parser.cpp) | 179 remove_srcs (../src/ports/SkFontMgr_android_parser.cpp) |
| 175 endif() | 180 endif() |
| 176 | 181 |
| 177 if (GIF_FOUND) | 182 if (GIF_FOUND) |
| 178 list (APPEND private_includes ${GIF_INCLUDE_DIRS}) | 183 list (APPEND private_includes ${GIF_INCLUDE_DIRS}) |
| 179 list (APPEND libs ${GIF_LIBRARIES}) | 184 list (APPEND libs ${GIF_LIBRARIES}) |
| 180 add_definitions(-DSK_HAS_GIF_LIBRARY) | 185 add_definitions(-DSK_HAS_GIF_LIBRARY) |
| 181 else() | 186 else() |
| 182 remove_srcs(../src/images/*GIF*) | 187 remove_srcs(../src/images/*GIF*) |
| 183 remove_srcs(../src/codec/*Gif*) | 188 remove_srcs(../src/codec/*Gif*) |
| 184 endif() | 189 endif() |
| 185 | 190 |
| 186 if (JPEG_FOUND) | 191 if (JPEG_TURBO_FOUND) |
| 187 list (APPEND private_includes ${JPEG_INCLUDE_DIRS}) | 192 list (APPEND private_includes ${JPEG_TURBO_INCLUDE_DIRS}) |
| 188 list (APPEND libs ${JPEG_LIBRARIES}) | 193 list (APPEND libs ${JPEG_TURBO_LIBRARIES}) |
| 189 add_definitions(-DSK_HAS_JPEG_LIBRARY) | 194 add_definitions(-DSK_HAS_JPEG_LIBRARY) |
| 190 else() | 195 else() |
| 191 remove_srcs(../src/images/*JPEG*) | 196 remove_srcs(../src/images/*JPEG*) |
| 192 remove_srcs(../src/codec/*Jpeg*) | 197 remove_srcs(../src/codec/*Jpeg*) |
| 193 endif() | 198 endif() |
| 194 | 199 |
| 195 if (LUA_FOUND) | 200 if (LUA_FOUND) |
| 196 list (APPEND private_includes ${LUA_INCLUDE_DIR}) | 201 list (APPEND private_includes ${LUA_INCLUDE_DIR}) |
| 197 list (APPEND libs ${LUA_LIBRARIES}) | 202 list (APPEND libs ${LUA_LIBRARIES}) |
| 198 else() | 203 else() |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n") | 356 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n") |
| 352 endif () | 357 endif () |
| 353 endforeach() | 358 endforeach() |
| 354 endif() | 359 endif() |
| 355 endforeach() | 360 endforeach() |
| 356 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n") | 361 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n") |
| 357 | 362 |
| 358 # Now build a simple example app that uses Skia via libskia.so. | 363 # Now build a simple example app that uses Skia via libskia.so. |
| 359 add_executable(example example.cpp) | 364 add_executable(example example.cpp) |
| 360 target_link_libraries(example skia ${OPENGL_LIBRARIES}) | 365 target_link_libraries(example skia ${OPENGL_LIBRARIES}) |
| OLD | NEW |