| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 remove_srcs (../src/images/SkForceLinking.cpp) | 47 remove_srcs (../src/images/SkForceLinking.cpp) |
| 48 # Chrome only? | 48 # Chrome only? |
| 49 remove_srcs (../src/ports/SkFontHost_fontconfig.cpp | 49 remove_srcs (../src/ports/SkFontHost_fontconfig.cpp |
| 50 ../src/fonts/SkFontMgr_fontconfig.cpp | 50 ../src/fonts/SkFontMgr_fontconfig.cpp |
| 51 ../src/ports/SkFontConfigInterface_direct.cpp) | 51 ../src/ports/SkFontConfigInterface_direct.cpp) |
| 52 # Alternative font managers. | 52 # Alternative font managers. |
| 53 remove_srcs (../src/ports/SkFontMgr_custom*.cpp) | 53 remove_srcs (../src/ports/SkFontMgr_custom*.cpp) |
| 54 | 54 |
| 55 # Skia sure ships a lot of code no one uses. | 55 # Skia sure ships a lot of code no one uses. |
| 56 remove_srcs (../src/animator/* ../src/*nacl* ../src/svg/* ../src/views/* ../src/
xml/*) | 56 remove_srcs (../src/animator/* ../src/*nacl* ../src/svg/* ../src/views/* ../src/
xml/*) |
| 57 foreach (include animator svg svg/parser views views/animated xml) |
| 58 file (GLOB globed_include ../include/${include}) |
| 59 list (REMOVE_ITEM public_includes ${globed_include}) |
| 60 endforeach() |
| 57 | 61 |
| 58 # Remove OS-specific source files. | 62 # Remove OS-specific source files. |
| 59 if (NOT UNIX) | 63 if (NOT UNIX) |
| 60 remove_srcs(../src/ports/*_posix.cpp | 64 remove_srcs(../src/ports/*_posix.cpp |
| 61 ../src/ports/SkTLS_pthread.cpp | 65 ../src/ports/SkTLS_pthread.cpp |
| 62 ../src/ports/SkTime_Unix.cpp | 66 ../src/ports/SkTime_Unix.cpp |
| 63 ../src/utils/SkThreadUtils_pthread.cpp) | 67 ../src/utils/SkThreadUtils_pthread.cpp) |
| 64 endif() | 68 endif() |
| 65 if (APPLE OR NOT UNIX) | 69 if (APPLE OR NOT UNIX) |
| 66 remove_srcs(../src/gpu/gl/glx/* | 70 remove_srcs(../src/gpu/gl/glx/* |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 get_filename_component (abs_include ${include} ABSOLUTE) | 283 get_filename_component (abs_include ${include} ABSOLUTE) |
| 280 file (APPEND ${compile_arguments} "-I${abs_include}\n") | 284 file (APPEND ${compile_arguments} "-I${abs_include}\n") |
| 281 endforeach() | 285 endforeach() |
| 282 | 286 |
| 283 # cmake . | 287 # cmake . |
| 284 # cmake --build . --target skia | 288 # cmake --build . --target skia |
| 285 # c++ -c @skia_compile_arguments.txt example.cpp | 289 # c++ -c @skia_compile_arguments.txt example.cpp |
| 286 # c++ example.o @skia_link_arguments.txt | 290 # c++ example.o @skia_link_arguments.txt |
| 287 | 291 |
| 288 # skia.h | 292 # skia.h |
| 293 set (bad_files GrGLConfig_chrome.h SkJSONCPP.h SkParsePaint.h) |
| 294 # make `c++ @skia_compile_arguments.txt include/skia.h` work. |
| 289 set (skia_h_path ${userconfig_directory}/skia.h) | 295 set (skia_h_path ${userconfig_directory}/skia.h) |
| 290 file (WRITE ${skia_h_path} "// skia.h generated by CMake.\n") | 296 file (WRITE ${skia_h_path} "// skia.h generated by CMake.\n") |
| 291 file(APPEND ${skia_h_path} "#ifndef skia_DEFINED\n") | 297 file(APPEND ${skia_h_path} "#ifndef skia_DEFINED\n") |
| 292 file(APPEND ${skia_h_path} "#define skia_DEFINED\n") | 298 file(APPEND ${skia_h_path} "#define skia_DEFINED\n") |
| 293 foreach (include ${public_includes}) | 299 foreach (include ${public_includes}) |
| 294 if (NOT include STREQUAL userconfig_directory) | 300 if (NOT include STREQUAL userconfig_directory) |
| 295 file (APPEND ${skia_h_path} "\n") | 301 file (APPEND ${skia_h_path} "\n") |
| 296 file (GLOB all_public_headers ${include}/*.h) | 302 file (GLOB all_public_headers ${include}/*.h) |
| 297 foreach (public_header ${all_public_headers}) | 303 foreach (public_header ${all_public_headers}) |
| 298 get_filename_component (filename_component ${public_header} NAME) | 304 get_filename_component (filename_component ${public_header} NAME) |
| 299 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n") | 305 if (NOT ";${bad_files};" MATCHES ";${filename_component};") |
| 306 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n") |
| 307 endif () |
| 300 endforeach() | 308 endforeach() |
| 301 endif() | 309 endif() |
| 302 endforeach() | 310 endforeach() |
| 303 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n") | 311 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n") |
| 304 | 312 |
| 305 # Now build a simple example app that uses Skia via libskia.so. | 313 # Now build a simple example app that uses Skia via libskia.so. |
| 306 add_executable(example example.cpp) | 314 add_executable(example example.cpp) |
| 307 target_link_libraries(example skia ${OPENGL_LIBRARIES}) | 315 target_link_libraries(example skia ${OPENGL_LIBRARIES}) |
| OLD | NEW |