blob: 73a40eeef12be09b302c4bf0642956dd2ea4bcc3 [file] [log] [blame]
mtkleine0f06a42015-08-28 11:51:06 -07001# Boilerplate.
mtklein0ce744e2015-09-01 09:22:31 -07002cmake_minimum_required (VERSION 3.1) # First version with CMAKE_CXX_STANDARD.
mtkleine0f06a42015-08-28 11:51:06 -07003project (skimake)
4set (CMAKE_CXX_STANDARD 11)
5
6# Default to Release mode. We're mainly targeting Skia users, not Skia developers.
7if (NOT CMAKE_BUILD_TYPE)
8 set (CMAKE_BUILD_TYPE Release)
9endif ()
10
11# To first approximation, the Skia library comprises all .cpp files under src/.
12file (GLOB_RECURSE srcs ../src/*.cpp)
13
14function (find_include_dirs out)
mtklein2409abb2015-08-31 06:59:21 -070015 file (GLOB_RECURSE headers ${ARGN})
mtkleine0f06a42015-08-28 11:51:06 -070016 foreach (path ${headers})
17 get_filename_component (dir ${path} PATH)
18 list (APPEND include_dirs ${dir})
19 endforeach()
20 list (REMOVE_DUPLICATES include_dirs)
21 set (${out} ${include_dirs} PARENT_SCOPE)
22endfunction()
23
24# We need src/ directories and include/private on our path when building Skia.
25# Users should be able to use Skia with only include/ directories that are not include/private.
26find_include_dirs(private_includes ../src/*.h ../include/private/*.h)
27find_include_dirs(public_includes ../include/*.h)
28list (REMOVE_ITEM public_includes ${private_includes}) # Easiest way to exclude private.
halcanary0cf5ecb2015-11-30 10:29:25 -080029file (GLOB default_include_config "../include/config")
30list (REMOVE_ITEM public_includes ${default_include_config})
halcanaryd1c94a42015-11-30 12:42:58 -080031set (userconfig_directory ${CMAKE_BINARY_DIR}/include)
halcanary0cf5ecb2015-11-30 10:29:25 -080032list (APPEND public_includes ${userconfig_directory})
mtkleine0f06a42015-08-28 11:51:06 -070033
34# These guys are third_party but provided by a Skia checkout.
35list (APPEND srcs ../third_party/etc1/etc1.cpp ../third_party/ktx/ktx.cpp)
36list (APPEND private_includes ../third_party/etc1 ../third_party/ktx)
37
scroggo39658252016-06-02 12:59:59 -070038list (APPEND private_includes ../third_party/libpng)
39file (GLOB libpng_srcs ../third_party/libpng/*.c)
40foreach (src ${libpng_srcs})
41 list (APPEND srcs ${src})
42endforeach()
43
44
mtkleine0f06a42015-08-28 11:51:06 -070045function (remove_srcs)
mtklein2409abb2015-08-31 06:59:21 -070046 file (GLOB_RECURSE to_remove ${ARGN})
mtkleine0f06a42015-08-28 11:51:06 -070047 list (REMOVE_ITEM srcs ${to_remove})
48 set (srcs ${srcs} PARENT_SCOPE)
49endfunction()
50
51# This file is empty and is only used to trick GYP.
52remove_srcs (../src/core/SkForceCPlusPlusLinking.cpp)
mtklein2409abb2015-08-31 06:59:21 -070053# Chrome only?
bungeman1ae0e012016-09-19 12:13:16 -070054remove_srcs (../src/ports/SkFontConfigInterface.cpp
55 ../src/ports/SkFontConfigInterface_direct.cpp
bungemanc1da4d02015-12-01 14:26:28 -050056 ../src/ports/SkFontConfigInterface_direct_factory.cpp
57 ../src/ports/SkFontConfigInterface_direct_google3.cpp
bungeman7d0e3bc2016-08-02 07:07:33 -070058 ../src/ports/SkFontConfigInterface_direct_google3_factory.cpp
59 ../src/ports/SkFontMgr_FontConfigInterface.cpp
60 ../src/ports/SkFontMgr_FontConfigInterface_factory.cpp)
mtklein2409abb2015-08-31 06:59:21 -070061# Alternative font managers.
62remove_srcs (../src/ports/SkFontMgr_custom*.cpp)
ethannicholasb3058bd2016-07-01 08:22:01 -070063# skslc main()
64remove_srcs (../src/sksl/SkSLMain.cpp)
65
mtkleine0f06a42015-08-28 11:51:06 -070066
67# Skia sure ships a lot of code no one uses.
68remove_srcs (../src/animator/* ../src/*nacl* ../src/svg/* ../src/views/* ../src/xml/*)
fmalita01c97232016-07-19 06:12:54 -070069foreach (include animator svg views xml gpu/vk)
halcanary0cbe7ee2015-12-01 09:02:49 -080070 file (GLOB globed_include ../include/${include})
71 list (REMOVE_ITEM public_includes ${globed_include})
72endforeach()
mtkleine0f06a42015-08-28 11:51:06 -070073
mtkleine0f06a42015-08-28 11:51:06 -070074# Remove OS-specific source files.
mtklein56c6a112015-09-30 11:06:53 -070075if (NOT UNIX)
mtklein1ee76512015-11-02 10:20:27 -080076 remove_srcs(../src/ports/*_posix.cpp
mtklein56c6a112015-09-30 11:06:53 -070077 ../src/ports/SkTLS_pthread.cpp
78 ../src/ports/SkTime_Unix.cpp
mtkleina1bde7d2015-10-20 11:05:06 -070079 ../src/utils/SkThreadUtils_pthread.cpp)
mtklein56c6a112015-09-30 11:06:53 -070080endif()
mtklein2409abb2015-08-31 06:59:21 -070081if (APPLE OR NOT UNIX)
82 remove_srcs(../src/gpu/gl/glx/*
mtklein2409abb2015-08-31 06:59:21 -070083 ../src/ports/SkFontMgr_fontconfig*.cpp
Ben Wagnera182b802016-01-21 17:38:13 -050084 ../src/ports/SkFontMgr_android*.cpp
mtklein2409abb2015-08-31 06:59:21 -070085 ../src/*FreeType*)
mtkleine0f06a42015-08-28 11:51:06 -070086endif()
mtkleine0f06a42015-08-28 11:51:06 -070087
88# Remove processor-specific source files.
mtklein0faed582015-09-14 12:02:32 -070089if (NOT CMAKE_SYSTEM_PROCESSOR STREQUAL ARM)
mtkleine0f06a42015-08-28 11:51:06 -070090 remove_srcs(../src/*arm* ../src/*ARM* ../src/*neon* ../src/*NEON*)
91endif()
mtklein0faed582015-09-14 12:02:32 -070092if (NOT CMAKE_SYSTEM_PROCESSOR STREQUAL MIPS)
mtkleine0f06a42015-08-28 11:51:06 -070093 remove_srcs(../src/*mips* ../src/*MIPS*)
94endif()
95
96# Make our ports choices.
97remove_srcs(
98 ../src/*moz* # We're probably not Mozilla.
99 ../src/gpu/GrContextFactory.cpp # For internal testing only.
100 ../src/gpu/gl/GrGLCreateNativeInterface_none.cpp
101 ../src/gpu/gl/GrGLDefaultInterface_none.cpp
mtkleine0f06a42015-08-28 11:51:06 -0700102 ../src/gpu/gl/command_buffer/*
103 ../src/gpu/gl/egl/*
abarth7fb19bc2016-03-28 11:34:27 -0700104 ../src/gpu/gl/glfw/*
mtkleine0f06a42015-08-28 11:51:06 -0700105 ../src/gpu/gl/iOS/*
egdanielb6ce10a2016-02-22 07:19:10 -0800106 ../src/gpu/vk/*
mtkleine0f06a42015-08-28 11:51:06 -0700107 ../src/opts/SkBitmapProcState_opts_none.cpp
108 ../src/opts/SkBlitMask_opts_none.cpp
109 ../src/opts/SkBlitRow_opts_none.cpp
110 ../src/ports/SkFontMgr_empty_factory.cpp
111 ../src/ports/SkGlobalInitialization_chromium.cpp
msarettc1d03122016-03-25 08:58:55 -0700112 ../src/ports/SkImageEncoder_none.cpp
mtkleine0f06a42015-08-28 11:51:06 -0700113 ../src/ports/SkImageGenerator_none.cpp
mtklein2409abb2015-08-31 06:59:21 -0700114 ../src/ports/SkTLS_none.cpp)
mtkleine0f06a42015-08-28 11:51:06 -0700115
msarettfdd52c42016-03-09 15:12:31 -0800116if (NOT APPLE)
117 remove_srcs(../src/ports/SkImageGeneratorCG.cpp)
118endif()
119
msarettfc0b6d12016-03-17 13:50:17 -0700120if (NOT WIN32)
121 remove_srcs(../src/ports/SkImageGeneratorWIC.cpp)
122endif()
123
mtklein56c6a112015-09-30 11:06:53 -0700124if (WIN32)
125 if(SKIA_GDI)
126 remove_srcs(../src/ports/SkFontMgr_win_dw_factory.cpp)
127 else()
128 remove_srcs(../src/ports/SkFontMgr_win_gdi_factory.cpp)
129 endif()
130endif()
131
mtkleinf6d8d282015-12-17 10:18:04 -0800132# Certain files must be compiled with support for SSSE3, SSE4.1, AVX, or AVX2 intrinsics.
mtkleine0f06a42015-08-28 11:51:06 -0700133file (GLOB_RECURSE ssse3_srcs ../src/*ssse3*.cpp ../src/*SSSE3*.cpp)
mtklein4e976072016-08-08 09:06:27 -0700134file (GLOB_RECURSE sse41_srcs ../src/*sse41*.cpp ../src/*SSE41*.cpp)
135file (GLOB_RECURSE sse42_srcs ../src/*sse42*.cpp ../src/*SSE42*.cpp)
mtkleinf6d8d282015-12-17 10:18:04 -0800136file (GLOB_RECURSE avx_srcs ../src/*_avx.cpp)
Mike Klein78d5a3b2016-09-30 10:48:01 -0400137file (GLOB_RECURSE hsw_srcs ../src/*_hsw.cpp)
halcanarydd4fcd42016-05-12 11:25:00 -0700138if (NOT WIN32)
139 set_source_files_properties(${ssse3_srcs} PROPERTIES COMPILE_FLAGS -mssse3)
140 set_source_files_properties(${sse41_srcs} PROPERTIES COMPILE_FLAGS -msse4.1)
mtklein4e976072016-08-08 09:06:27 -0700141 set_source_files_properties(${sse42_srcs} PROPERTIES COMPILE_FLAGS -msse4.2)
halcanarydd4fcd42016-05-12 11:25:00 -0700142 set_source_files_properties(${avx_srcs} PROPERTIES COMPILE_FLAGS -mavx)
Mike Klein78d5a3b2016-09-30 10:48:01 -0400143 set_source_files_properties(${hsw_srcs} PROPERTIES COMPILE_FLAGS
144 -mavx2 -mbmi -mbmi2 -mf16c -mfma)
halcanarydd4fcd42016-05-12 11:25:00 -0700145endif()
mtkleine0f06a42015-08-28 11:51:06 -0700146
147# Detect our optional dependencies.
148# If we can't find them, don't build the parts of Skia that use them.
mtklein1ee76512015-11-02 10:20:27 -0800149find_package (EXPAT)
mtklein2409abb2015-08-31 06:59:21 -0700150find_package (Lua)
mtkleine0f06a42015-08-28 11:51:06 -0700151find_package (ZLIB)
mtkleind805f202016-08-23 11:01:33 -0700152
153# For libraries that don't have find_package() scripts, we do it ourselves:
mtkleine0f06a42015-08-28 11:51:06 -0700154find_path (WEBP_INCLUDE_DIRS "webp/decode.h")
mtkleind805f202016-08-23 11:01:33 -0700155find_library (WEBP_LIBRARIES "webp")
156
halcanary4ae26252015-09-21 09:42:23 -0700157find_path (OSMESA_INCLUDE_DIRS "GL/osmesa.h")
158find_library(OSMESA_LIBRARIES "OSMesa")
mtkleine0f06a42015-08-28 11:51:06 -0700159
mtklein2409abb2015-08-31 06:59:21 -0700160if (UNIX AND NOT APPLE)
161 find_package (Freetype)
mtkleind805f202016-08-23 11:01:33 -0700162 find_package (GIF)
163
mtklein2409abb2015-08-31 06:59:21 -0700164 find_path (FONTCONFIG_INCLUDE_DIRS "fontconfig/fontconfig.h")
165 find_library (FONTCONFIG_LIBRARIES fontconfig)
mtkleind805f202016-08-23 11:01:33 -0700166
167 # We require libjpeg-turbo >= 1.5.0.
168 find_package(PkgConfig)
169 pkg_check_modules(JPEG_TURBO libjpeg>=1.5.0)
mtklein2409abb2015-08-31 06:59:21 -0700170endif()
171
msarett4691d992016-02-16 13:16:39 -0800172# Do not compile SkRawCodec.
173remove_srcs(../src/codec/*Raw*.cpp)
174
mtklein2409abb2015-08-31 06:59:21 -0700175# TODO: macro away this if (found) ... else() ... endif() stuff.
176
mtklein1ee76512015-11-02 10:20:27 -0800177if (EXPAT_FOUND)
178 list (APPEND private_includes ${EXPAT_INCLUDE_DIRS})
179 list (APPEND libs ${EXPAT_LIBRARIES})
180else()
181 remove_srcs (../src/ports/SkFontMgr_android_parser.cpp)
182endif()
183
mtklein2409abb2015-08-31 06:59:21 -0700184if (GIF_FOUND)
185 list (APPEND private_includes ${GIF_INCLUDE_DIRS})
186 list (APPEND libs ${GIF_LIBRARIES})
msarettad3a5c62016-05-06 07:21:26 -0700187 add_definitions(-DSK_HAS_GIF_LIBRARY)
mtklein2409abb2015-08-31 06:59:21 -0700188else()
msarettc1d03122016-03-25 08:58:55 -0700189 remove_srcs(../src/images/*GIF*)
msarett39b2d5a2016-02-17 08:26:31 -0800190 remove_srcs(../src/codec/*Gif*)
mtkleine0f06a42015-08-28 11:51:06 -0700191endif()
mtklein2409abb2015-08-31 06:59:21 -0700192
mtkleind805f202016-08-23 11:01:33 -0700193if (JPEG_TURBO_FOUND)
194 list (APPEND private_includes ${JPEG_TURBO_INCLUDE_DIRS})
195 list (APPEND libs ${JPEG_TURBO_LIBRARIES})
msarettad3a5c62016-05-06 07:21:26 -0700196 add_definitions(-DSK_HAS_JPEG_LIBRARY)
mtklein2409abb2015-08-31 06:59:21 -0700197else()
msarettc1d03122016-03-25 08:58:55 -0700198 remove_srcs(../src/images/*JPEG*)
msarett39b2d5a2016-02-17 08:26:31 -0800199 remove_srcs(../src/codec/*Jpeg*)
mtkleine0f06a42015-08-28 11:51:06 -0700200endif()
mtklein2409abb2015-08-31 06:59:21 -0700201
202if (LUA_FOUND)
203 list (APPEND private_includes ${LUA_INCLUDE_DIR})
204 list (APPEND libs ${LUA_LIBRARIES})
205else()
206 remove_srcs(../src/utils/*Lua*)
mtkleine0f06a42015-08-28 11:51:06 -0700207endif()
mtklein2409abb2015-08-31 06:59:21 -0700208
scroggo39658252016-06-02 12:59:59 -0700209# PNG
210add_definitions(-DSK_HAS_PNG_LIBRARY)
211add_definitions(-DPNG_ARM_NEON_OPT=0)
mtklein2409abb2015-08-31 06:59:21 -0700212
213if (ZLIB_FOUND)
214 list (APPEND private_includes ${ZLIB_INCLUDE_DIRS})
215 list (APPEND libs ${ZLIB_LIBRARIES})
halcanary23f4d4d2016-03-12 05:59:39 -0800216 remove_srcs(../src/pdf/SkDocument_PDF_None.cpp)
mtklein2409abb2015-08-31 06:59:21 -0700217else()
halcanary23f4d4d2016-03-12 05:59:39 -0800218 remove_srcs(../src/pdf/*.cpp)
219 set (srcs ${srcs} ../src/pdf/SkDocument_PDF_None.cpp)
mtkleine0f06a42015-08-28 11:51:06 -0700220endif()
mtklein2409abb2015-08-31 06:59:21 -0700221
222if (WEBP_INCLUDE_DIRS AND WEBP_LIBRARIES)
223 list (APPEND private_includes ${WEBP_INCLUDE_DIRS})
224 list (APPEND libs ${WEBP_LIBRARIES})
msarettad3a5c62016-05-06 07:21:26 -0700225 add_definitions(-DSK_HAS_WEBP_LIBRARY)
mtklein2409abb2015-08-31 06:59:21 -0700226else()
msarettc1d03122016-03-25 08:58:55 -0700227 remove_srcs(../src/images/*WEBP*)
msarett39b2d5a2016-02-17 08:26:31 -0800228 remove_srcs(../src/codec/*Webp*)
mtkleine0f06a42015-08-28 11:51:06 -0700229endif()
230
mtklein2409abb2015-08-31 06:59:21 -0700231if (FREETYPE_FOUND)
232 list (APPEND private_includes ${FREETYPE_INCLUDE_DIRS})
233 list (APPEND libs ${FREETYPE_LIBRARIES})
234endif()
235
236if (FONTCONFIG_INCLUDE_DIRS AND FONTCONFIG_LIBRARIES)
237 list (APPEND private_includes ${FONTCONFIG_INCLUDE_DIRS})
238 list (APPEND libs ${FONTCONFIG_LIBRARIES})
239endif()
240
mtkleine0f06a42015-08-28 11:51:06 -0700241if (APPLE)
mtklein2409abb2015-08-31 06:59:21 -0700242 find_library(APPLICATION_SERVICES_FRAMEWORK ApplicationServices REQUIRED)
243 list (APPEND libs ${APPLICATION_SERVICES_FRAMEWORK})
mtkleine0f06a42015-08-28 11:51:06 -0700244endif()
245
halcanary4ae26252015-09-21 09:42:23 -0700246if (OSMESA_LIBRARIES AND OSMESA_INCLUDE_DIRS)
247 list (APPEND libs ${OSMESA_LIBRARIES})
248 list (APPEND private_includes ${OSMESA_INCLUDE_DIRS})
249 list (APPEND public_defines "-DSK_MESA=1")
mtklein014f06b2016-01-05 08:32:32 -0800250 set (SK_MESA 1)
halcanary4ae26252015-09-21 09:42:23 -0700251else()
252 remove_srcs(../src/gpu/gl/mesa/*)
halcanary4ae26252015-09-21 09:42:23 -0700253endif()
254
mtklein56c6a112015-09-30 11:06:53 -0700255if (WIN32)
256 list (APPEND libs FontSub.lib Usp10.lib)
mtklein7dd44672016-05-24 09:44:05 -0700257else()
258 list (APPEND libs pthread)
mtklein56c6a112015-09-30 11:06:53 -0700259endif()
260
halcanary2a4a4212015-09-01 10:11:44 -0700261find_package(OpenGL REQUIRED)
262list (APPEND libs ${OPENGL_LIBRARIES})
263
mtklein7dd44672016-05-24 09:44:05 -0700264# This is our main output, libskia.{a,so,dll,dylib,etc...}
265# You can control whether this is static or shared with BUILD_SHARED_LIBS.
266add_library (skia ${srcs})
mtkleine0f06a42015-08-28 11:51:06 -0700267
268target_compile_definitions(skia
halcanary4ae26252015-09-21 09:42:23 -0700269 PUBLIC ${public_defines}
mtklein56c6a112015-09-30 11:06:53 -0700270 PRIVATE -DSKIA_DLL -DSKIA_IMPLEMENTATION=1)
mtkleine0f06a42015-08-28 11:51:06 -0700271
272target_include_directories(skia
273 PUBLIC ${public_includes}
mtklein2409abb2015-08-31 06:59:21 -0700274 PRIVATE ${private_includes})
mtkleine0f06a42015-08-28 11:51:06 -0700275
276target_link_libraries(skia
277 PUBLIC
mtklein2409abb2015-08-31 06:59:21 -0700278 PRIVATE ${libs})
279
mtklein56c6a112015-09-30 11:06:53 -0700280if (MSVC)
halcanarydd4fcd42016-05-12 11:25:00 -0700281 string(REGEX REPLACE " /W3 " " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
mtklein56c6a112015-09-30 11:06:53 -0700282 set(cc_flags "/w /GR-")
283else()
284 set(cc_flags "-w -fno-rtti -fno-exceptions")
285endif()
mtkleine0f06a42015-08-28 11:51:06 -0700286
287set_target_properties(skia PROPERTIES
mtklein7dd44672016-05-24 09:44:05 -0700288 COMPILE_FLAGS ${cc_flags})
289if (BUILD_SHARED_LIBS)
290 set_target_properties(skia PROPERTIES
291 CXX_VISIBILITY_PRESET hidden
292 VISIBILITY_INLINES_HIDDEN true)
293endif()
mtkleine0f06a42015-08-28 11:51:06 -0700294
halcanary5a9a5b32015-09-03 14:23:17 -0700295# Experimental C API install:
mtkleina5b0f032015-09-29 13:16:33 -0700296file(GLOB c_headers "../include/c/*.h")
297install(FILES ${c_headers} DESTINATION include)
halcanary5a9a5b32015-09-03 14:23:17 -0700298install(TARGETS skia DESTINATION lib)
299
halcanaryd1c94a42015-11-30 12:42:58 -0800300# SkUserConfig.h
halcanaryd1c94a42015-11-30 12:42:58 -0800301if (CMAKE_BUILD_TYPE STREQUAL Release)
mtklein014f06b2016-01-05 08:32:32 -0800302 set (SK_RELEASE 1)
mtklein95bc09b2016-01-07 06:56:11 -0800303else()
304 set (SK_RELEASE 0)
halcanaryd1c94a42015-11-30 12:42:58 -0800305endif()
marco.diigacce49272016-03-25 09:01:26 -0700306if (UNIX AND NOT APPLE)
307 set (SK_SAMPLES_FOR_X 1)
308else()
309 set (SK_SAMPLES_FOR_X 0)
310endif()
mtklein014f06b2016-01-05 08:32:32 -0800311configure_file ("SkUserConfig.h.in" "${userconfig_directory}/SkUserConfig.h")
halcanaryd1c94a42015-11-30 12:42:58 -0800312
313# skia_link_arguments.txt
314set (link_arguments ${CMAKE_BINARY_DIR}/skia_link_arguments.txt)
halcanary5d04fda2016-05-24 11:23:23 -0700315if (BUILD_SHARED_LIBS)
316 file (WRITE ${link_arguments} "-L${CMAKE_BINARY_DIR}\n")
317 file (APPEND ${link_arguments} "-lskia\n")
318 file (APPEND ${link_arguments} "-Wl,-rpath,${CMAKE_BINARY_DIR}\n")
319else()
320 file (WRITE ${link_arguments} "${CMAKE_BINARY_DIR}/libskia.a\n")
321 foreach (lib ${libs})
322 if (EXISTS ${lib})
323 get_filename_component(lib_path ${lib} ABSOLUTE)
324 file (APPEND ${link_arguments} "${lib_path}\n")
325 else()
326 file (APPEND ${link_arguments} "-l${lib}\n")
327 endif()
328 endforeach()
329endif()
halcanaryd1c94a42015-11-30 12:42:58 -0800330
331# skia_compile_arguments.txt
332set (compile_arguments ${CMAKE_BINARY_DIR}/skia_compile_arguments.txt)
333file (WRITE ${compile_arguments} "--std=c++11\n")
334foreach (include ${public_includes})
335 get_filename_component (abs_include ${include} ABSOLUTE)
336 file (APPEND ${compile_arguments} "-I${abs_include}\n")
337endforeach()
338
339# cmake .
340# cmake --build . --target skia
341# c++ -c @skia_compile_arguments.txt example.cpp
342# c++ example.o @skia_link_arguments.txt
343
344# skia.h
mtklein1b51e0e2016-07-26 12:41:27 -0700345set (bad_files GrGLConfig_chrome.h)
halcanary0cbe7ee2015-12-01 09:02:49 -0800346# make `c++ @skia_compile_arguments.txt include/skia.h` work.
halcanaryd1c94a42015-11-30 12:42:58 -0800347set (skia_h_path ${userconfig_directory}/skia.h)
348file (WRITE ${skia_h_path} "// skia.h generated by CMake.\n")
349file(APPEND ${skia_h_path} "#ifndef skia_DEFINED\n")
350file(APPEND ${skia_h_path} "#define skia_DEFINED\n")
351foreach (include ${public_includes})
352 if (NOT include STREQUAL userconfig_directory)
353 file (APPEND ${skia_h_path} "\n")
354 file (GLOB all_public_headers ${include}/*.h)
355 foreach (public_header ${all_public_headers})
356 get_filename_component (filename_component ${public_header} NAME)
halcanary0cbe7ee2015-12-01 09:02:49 -0800357 if (NOT ";${bad_files};" MATCHES ";${filename_component};")
358 file (APPEND ${skia_h_path} "#include \"${filename_component}\"\n")
359 endif ()
halcanaryd1c94a42015-11-30 12:42:58 -0800360 endforeach()
361 endif()
362endforeach()
363file(APPEND ${skia_h_path} "\n#endif // skia_DEFINED\n")
364
mtkleine0f06a42015-08-28 11:51:06 -0700365# Now build a simple example app that uses Skia via libskia.so.
mtkleine0f06a42015-08-28 11:51:06 -0700366add_executable(example example.cpp)
367target_link_libraries(example skia ${OPENGL_LIBRARIES})