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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 get_filename_component (abs_include ${include} ABSOLUTE) | 326 get_filename_component (abs_include ${include} ABSOLUTE) |
327 file (APPEND ${compile_arguments} "-I${abs_include}\n") | 327 file (APPEND ${compile_arguments} "-I${abs_include}\n") |
328 endforeach() | 328 endforeach() |
329 | 329 |
330 # cmake . | 330 # cmake . |
331 # cmake --build . --target skia | 331 # cmake --build . --target skia |
332 # c++ -c @skia_compile_arguments.txt example.cpp | 332 # c++ -c @skia_compile_arguments.txt example.cpp |
333 # c++ example.o @skia_link_arguments.txt | 333 # c++ example.o @skia_link_arguments.txt |
334 | 334 |
335 # skia.h | 335 # skia.h |
336 set (bad_files GrGLConfig_chrome.h SkJSONCPP.h SkParsePaint.h) | 336 set (bad_files GrGLConfig_chrome.h) |
337 # make `c++ @skia_compile_arguments.txt include/skia.h` work. | 337 # make `c++ @skia_compile_arguments.txt include/skia.h` work. |
338 set (skia_h_path ${userconfig_directory}/skia.h) | 338 set (skia_h_path ${userconfig_directory}/skia.h) |
339 file (WRITE ${skia_h_path} "// skia.h generated by CMake.\n") | 339 file (WRITE ${skia_h_path} "// skia.h generated by CMake.\n") |
340 file(APPEND ${skia_h_path} "#ifndef skia_DEFINED\n") | 340 file(APPEND ${skia_h_path} "#ifndef skia_DEFINED\n") |
341 file(APPEND ${skia_h_path} "#define skia_DEFINED\n") | 341 file(APPEND ${skia_h_path} "#define skia_DEFINED\n") |
342 foreach (include ${public_includes}) | 342 foreach (include ${public_includes}) |
343 if (NOT include STREQUAL userconfig_directory) | 343 if (NOT include STREQUAL userconfig_directory) |
344 file (APPEND ${skia_h_path} "\n") | 344 file (APPEND ${skia_h_path} "\n") |
345 file (GLOB all_public_headers ${include}/*.h) | 345 file (GLOB all_public_headers ${include}/*.h) |
346 foreach (public_header ${all_public_headers}) | 346 foreach (public_header ${all_public_headers}) |
347 get_filename_component (filename_component ${public_header} NAME) | 347 get_filename_component (filename_component ${public_header} NAME) |
348 if (NOT ";${bad_files};" MATCHES ";${filename_component};") | 348 if (NOT ";${bad_files};" MATCHES ";${filename_component};") |
349 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n") | 349 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n") |
350 endif () | 350 endif () |
351 endforeach() | 351 endforeach() |
352 endif() | 352 endif() |
353 endforeach() | 353 endforeach() |
354 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n") | 354 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n") |
355 | 355 |
356 # Now build a simple example app that uses Skia via libskia.so. | 356 # Now build a simple example app that uses Skia via libskia.so. |
357 add_executable(example example.cpp) | 357 add_executable(example example.cpp) |
358 target_link_libraries(example skia ${OPENGL_LIBRARIES}) | 358 target_link_libraries(example skia ${OPENGL_LIBRARIES}) |
OLD | NEW |