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 17 matching lines...) Expand all Loading... | |
28 list (REMOVE_ITEM public_includes ${private_includes}) # Easiest way to exclude private. | 28 list (REMOVE_ITEM public_includes ${private_includes}) # Easiest way to exclude private. |
29 file (GLOB default_include_config "../include/config") | 29 file (GLOB default_include_config "../include/config") |
30 list (REMOVE_ITEM public_includes ${default_include_config}) | 30 list (REMOVE_ITEM public_includes ${default_include_config}) |
31 set (userconfig_directory ${CMAKE_BINARY_DIR}/include) | 31 set (userconfig_directory ${CMAKE_BINARY_DIR}/include) |
32 list (APPEND public_includes ${userconfig_directory}) | 32 list (APPEND public_includes ${userconfig_directory}) |
33 | 33 |
34 # These guys are third_party but provided by a Skia checkout. | 34 # These guys are third_party but provided by a Skia checkout. |
35 list (APPEND srcs ../third_party/etc1/etc1.cpp ../third_party/ktx/kt x.cpp) | 35 list (APPEND srcs ../third_party/etc1/etc1.cpp ../third_party/ktx/kt x.cpp) |
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 list (APPEND private_includes ../third_party/libpng) | |
scroggo
2016/06/02 16:15:10
I know very little of CMake, and I'm still working
msarett
2016/06/02 16:35:33
Looks right, I think, though I haven't done too mu
scroggo
2016/06/02 17:03:27
Done.
msarett
2016/06/02 17:10:36
The CMake trybots actually run automatically in th
| |
39 file (GLOB libpng_srcs ../third_party/libpng/*.c) | |
40 foreach (src ${libpng_srcs}) | |
41 list (APPEND srcs ${src}) | |
42 endforeach() | |
43 | |
38 function (remove_srcs) | 44 function (remove_srcs) |
39 file (GLOB_RECURSE to_remove ${ARGN}) | 45 file (GLOB_RECURSE to_remove ${ARGN}) |
40 list (REMOVE_ITEM srcs ${to_remove}) | 46 list (REMOVE_ITEM srcs ${to_remove}) |
41 set (srcs ${srcs} PARENT_SCOPE) | 47 set (srcs ${srcs} PARENT_SCOPE) |
42 endfunction() | 48 endfunction() |
43 | 49 |
44 # This file is empty and is only used to trick GYP. | 50 # This file is empty and is only used to trick GYP. |
45 remove_srcs (../src/core/SkForceCPlusPlusLinking.cpp) | 51 remove_srcs (../src/core/SkForceCPlusPlusLinking.cpp) |
46 # Chrome only? | 52 # Chrome only? |
47 remove_srcs (../src/ports/SkFontHost_fontconfig.cpp | 53 remove_srcs (../src/ports/SkFontHost_fontconfig.cpp |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
141 find_path (OSMESA_INCLUDE_DIRS "GL/osmesa.h") | 147 find_path (OSMESA_INCLUDE_DIRS "GL/osmesa.h") |
142 find_library(OSMESA_LIBRARIES "OSMesa") | 148 find_library(OSMESA_LIBRARIES "OSMesa") |
143 | 149 |
144 if (UNIX AND NOT APPLE) | 150 if (UNIX AND NOT APPLE) |
145 find_package (Freetype) | 151 find_package (Freetype) |
146 # Same deal for fontconfig. | 152 # Same deal for fontconfig. |
147 find_path (FONTCONFIG_INCLUDE_DIRS "fontconfig/fontconfig.h") | 153 find_path (FONTCONFIG_INCLUDE_DIRS "fontconfig/fontconfig.h") |
148 find_library (FONTCONFIG_LIBRARIES fontconfig) | 154 find_library (FONTCONFIG_LIBRARIES fontconfig) |
149 find_package (GIF) | 155 find_package (GIF) |
150 find_package (JPEG) | 156 find_package (JPEG) |
151 find_package (PNG) | |
152 endif() | 157 endif() |
153 | 158 |
154 # Do not compile SkRawCodec. | 159 # Do not compile SkRawCodec. |
155 remove_srcs(../src/codec/*Raw*.cpp) | 160 remove_srcs(../src/codec/*Raw*.cpp) |
156 | 161 |
157 # TODO: macro away this if (found) ... else() ... endif() stuff. | 162 # TODO: macro away this if (found) ... else() ... endif() stuff. |
158 | 163 |
159 if (EXPAT_FOUND) | 164 if (EXPAT_FOUND) |
160 list (APPEND private_includes ${EXPAT_INCLUDE_DIRS}) | 165 list (APPEND private_includes ${EXPAT_INCLUDE_DIRS}) |
161 list (APPEND libs ${EXPAT_LIBRARIES}) | 166 list (APPEND libs ${EXPAT_LIBRARIES}) |
(...skipping 19 matching lines...) Expand all Loading... | |
181 remove_srcs(../src/codec/*Jpeg*) | 186 remove_srcs(../src/codec/*Jpeg*) |
182 endif() | 187 endif() |
183 | 188 |
184 if (LUA_FOUND) | 189 if (LUA_FOUND) |
185 list (APPEND private_includes ${LUA_INCLUDE_DIR}) | 190 list (APPEND private_includes ${LUA_INCLUDE_DIR}) |
186 list (APPEND libs ${LUA_LIBRARIES}) | 191 list (APPEND libs ${LUA_LIBRARIES}) |
187 else() | 192 else() |
188 remove_srcs(../src/utils/*Lua*) | 193 remove_srcs(../src/utils/*Lua*) |
189 endif() | 194 endif() |
190 | 195 |
191 if (PNG_FOUND) | 196 # PNG |
192 list (APPEND private_includes ${PNG_INCLUDE_DIRS}) | |
193 list (APPEND libs ${PNG_LIBRARIES}) | |
194 add_definitions(-DPNG_SKIP_SETJMP_CHECK) | 197 add_definitions(-DPNG_SKIP_SETJMP_CHECK) |
scroggo
2016/06/02 16:15:10
I did not see this or PNG_SKIP_SKIA_OPTS anywhere
msarett
2016/06/02 16:35:33
I believe that they are both safe to delete.
nit:
scroggo
2016/06/02 17:03:27
Removed.
| |
195 add_definitions(-DPNG_SKIP_SKIA_OPTS) | 198 add_definitions(-DPNG_SKIP_SKIA_OPTS) |
196 add_definitions(-DSK_HAS_PNG_LIBRARY) | 199 add_definitions(-DSK_HAS_PNG_LIBRARY) |
197 else() | |
198 remove_srcs(../src/images/*PNG*) | |
199 remove_srcs(../src/codec/*Png*) | |
200 remove_srcs(../src/codec/*Ico*) | |
201 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 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
348 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n") | 346 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n") |
349 endif () | 347 endif () |
350 endforeach() | 348 endforeach() |
351 endif() | 349 endif() |
352 endforeach() | 350 endforeach() |
353 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n") | 351 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n") |
354 | 352 |
355 # Now build a simple example app that uses Skia via libskia.so. | 353 # Now build a simple example app that uses Skia via libskia.so. |
356 add_executable(example example.cpp) | 354 add_executable(example example.cpp) |
357 target_link_libraries(example skia ${OPENGL_LIBRARIES}) | 355 target_link_libraries(example skia ${OPENGL_LIBRARIES}) |
OLD | NEW |