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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 209 |
210 if (APPLE) | 210 if (APPLE) |
211 find_library(APPLICATION_SERVICES_FRAMEWORK ApplicationServices REQUIRED) | 211 find_library(APPLICATION_SERVICES_FRAMEWORK ApplicationServices REQUIRED) |
212 list (APPEND libs ${APPLICATION_SERVICES_FRAMEWORK}) | 212 list (APPEND libs ${APPLICATION_SERVICES_FRAMEWORK}) |
213 endif() | 213 endif() |
214 | 214 |
215 if (OSMESA_LIBRARIES AND OSMESA_INCLUDE_DIRS) | 215 if (OSMESA_LIBRARIES AND OSMESA_INCLUDE_DIRS) |
216 list (APPEND libs ${OSMESA_LIBRARIES}) | 216 list (APPEND libs ${OSMESA_LIBRARIES}) |
217 list (APPEND private_includes ${OSMESA_INCLUDE_DIRS}) | 217 list (APPEND private_includes ${OSMESA_INCLUDE_DIRS}) |
218 list (APPEND public_defines "-DSK_MESA=1") | 218 list (APPEND public_defines "-DSK_MESA=1") |
| 219 set (SK_MESA 1) |
219 else() | 220 else() |
220 remove_srcs(../src/gpu/gl/mesa/*) | 221 remove_srcs(../src/gpu/gl/mesa/*) |
221 endif() | 222 endif() |
222 | 223 |
223 if (WIN32) | 224 if (WIN32) |
224 list (APPEND libs FontSub.lib Usp10.lib) | 225 list (APPEND libs FontSub.lib Usp10.lib) |
225 endif() | 226 endif() |
226 | 227 |
227 find_package(OpenGL REQUIRED) | 228 find_package(OpenGL REQUIRED) |
228 list (APPEND libs ${OPENGL_LIBRARIES}) | 229 list (APPEND libs ${OPENGL_LIBRARIES}) |
(...skipping 25 matching lines...) Expand all Loading... |
254 COMPILE_FLAGS ${cc_flags} | 255 COMPILE_FLAGS ${cc_flags} |
255 CXX_VISIBILITY_PRESET hidden | 256 CXX_VISIBILITY_PRESET hidden |
256 VISIBILITY_INLINES_HIDDEN true) | 257 VISIBILITY_INLINES_HIDDEN true) |
257 | 258 |
258 # Experimental C API install: | 259 # Experimental C API install: |
259 file(GLOB c_headers "../include/c/*.h") | 260 file(GLOB c_headers "../include/c/*.h") |
260 install(FILES ${c_headers} DESTINATION include) | 261 install(FILES ${c_headers} DESTINATION include) |
261 install(TARGETS skia DESTINATION lib) | 262 install(TARGETS skia DESTINATION lib) |
262 | 263 |
263 # SkUserConfig.h | 264 # SkUserConfig.h |
264 set (userconfig_path ${userconfig_directory}/SkUserConfig.h) | |
265 file(WRITE ${userconfig_path} "// SkUserConfig generated by CMake.\n") | |
266 file(APPEND ${userconfig_path} "#ifndef SkUserConfig_DEFINED\n") | |
267 file(APPEND ${userconfig_path} "#define SkUserConfig_DEFINED\n") | |
268 if (CMAKE_BUILD_TYPE STREQUAL Release) | 265 if (CMAKE_BUILD_TYPE STREQUAL Release) |
269 file(APPEND ${userconfig_path} "#define SK_RELEASE\n") | 266 set (SK_RELEASE 1) |
270 file(APPEND ${userconfig_path} "#undef SK_DEBUG\n") | |
271 else () | |
272 file(APPEND ${userconfig_path} "#define SK_DEBUG\n") | |
273 file(APPEND ${userconfig_path} "#undef SK_RELEASE\n") | |
274 endif () | |
275 if (OSMESA_LIBRARIES AND OSMESA_INCLUDE_DIRS) | |
276 file (APPEND ${userconfig_path} "#define SK_MESA 1\n") | |
277 endif() | 267 endif() |
278 file(APPEND ${userconfig_path} "#endif // SkUserConfig_DEFINED\n") | 268 configure_file ("SkUserConfig.h.in" "${userconfig_directory}/SkUserConfig.h") |
279 | 269 |
280 # skia_link_arguments.txt | 270 # skia_link_arguments.txt |
281 set (link_arguments ${CMAKE_BINARY_DIR}/skia_link_arguments.txt) | 271 set (link_arguments ${CMAKE_BINARY_DIR}/skia_link_arguments.txt) |
282 file (WRITE ${link_arguments} "-L${CMAKE_BINARY_DIR}\n") | 272 file (WRITE ${link_arguments} "-L${CMAKE_BINARY_DIR}\n") |
283 file (APPEND ${link_arguments} "-lskia\n") | 273 file (APPEND ${link_arguments} "-lskia\n") |
284 file (APPEND ${link_arguments} "-Wl,-rpath,${CMAKE_BINARY_DIR}\n") | 274 file (APPEND ${link_arguments} "-Wl,-rpath,${CMAKE_BINARY_DIR}\n") |
285 | 275 |
286 # skia_compile_arguments.txt | 276 # skia_compile_arguments.txt |
287 set (compile_arguments ${CMAKE_BINARY_DIR}/skia_compile_arguments.txt) | 277 set (compile_arguments ${CMAKE_BINARY_DIR}/skia_compile_arguments.txt) |
288 file (WRITE ${compile_arguments} "--std=c++11\n") | 278 file (WRITE ${compile_arguments} "--std=c++11\n") |
(...skipping 24 matching lines...) Expand all Loading... |
313 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n") | 303 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n") |
314 endif () | 304 endif () |
315 endforeach() | 305 endforeach() |
316 endif() | 306 endif() |
317 endforeach() | 307 endforeach() |
318 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n") | 308 file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n") |
319 | 309 |
320 # Now build a simple example app that uses Skia via libskia.so. | 310 # Now build a simple example app that uses Skia via libskia.so. |
321 add_executable(example example.cpp) | 311 add_executable(example example.cpp) |
322 target_link_libraries(example skia ${OPENGL_LIBRARIES}) | 312 target_link_libraries(example skia ${OPENGL_LIBRARIES}) |
OLD | NEW |