-
-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathCMakeLists.txt
147 lines (113 loc) · 3.98 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
cmake_minimum_required(VERSION 3.16.0)
project(picasso LANGUAGES C CXX ASM HOMEPAGE_URL https://onecoolx.github.io/picasso/)
set(PROJECT_ROOT ${CMAKE_CURRENT_LIST_DIR})
set(PROJECT_OUT ${CMAKE_CURRENT_BINARY_DIR})
set(VERSION_MAJOR 2)
set(VERSION_MINOR 8)
set(VERSION_MICRO 0)
set(VERSION_INFO ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO})
option(BUILD_SHARED_LIBS "Build shared libraries (default)" ON)
option(OPT_FORMAT_ABGR "Pixel format ABGR support." ON)
option(OPT_FORMAT_ARGB "Pixel format ARGB support." ON)
option(OPT_FORMAT_BGRA "Pixel format BGRA support." ON)
option(OPT_FORMAT_RGBA "Pixel format RGBA support." ON)
option(OPT_FORMAT_RGB "Pixel format RGB support." ON)
option(OPT_FORMAT_BGR "Pixel format BGR support." ON)
option(OPT_FORMAT_RGB565 "Pixel format RGB565 support." ON)
option(OPT_FORMAT_RGB555 "Pixel format RGB555 support." ON)
option(OPT_FORMAT_A8 "Pixel format A8 support." ON)
option(OPT_FAST_COPY "Build Fast Memory Copy used support." OFF)
option(OPT_FREE_TYPE2 "Build FreeType2 is support." OFF)
option(OPT_FONT_CONFIG "Build FontConfig is support." OFF)
option(OPT_LOW_MEMORY "Build Low Memory used support." OFF)
option(OPT_SYSTEM_MALLOC "Build System Memory Allocator (new/delete/malloc/free/realloc/calloc) used support." OFF)
option(OPT_EXTENSIONS "Build extension libraries." ON)
option(OPT_TESTS "Build test apps" ON)
option(OPT_DEMOS "Build example demos" ON)
option(OPT_UNITTEST "Build unit tests" OFF)
option(OPT_SANITIZE "Build with Sanitizer" OFF)
option(OPT_COVERAGE "Build with Coverage" OFF)
option(OPT_SYSTEM_GIF "Use system giflib" OFF)
option(OPT_SYSTEM_JPEG "Use system libjpeg" OFF)
option(OPT_SYSTEM_PNG "Use system libpng" OFF)
option(OPT_SYSTEM_WEBP "Use system libwebp" OFF)
option(OPT_SYSTEM_ZLIB "Use system zlib" OFF)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build type" FORCE)
endif()
include (${CMAKE_CURRENT_LIST_DIR}/build/configs.cmake)
include (${CMAKE_CURRENT_LIST_DIR}/build/defines.cmake)
include (${CMAKE_CURRENT_LIST_DIR}/src/src.cmake)
find_library(ZLIB z)
find_library(PNG png)
find_library(JPEG jpeg)
find_library(GIF gif)
find_library(WEBP webp)
if (OPT_EXTENSIONS)
include (${CMAKE_CURRENT_LIST_DIR}/third_party/third_party.cmake)
include (${CMAKE_CURRENT_LIST_DIR}/ext/ext.cmake)
endif()
include (${CMAKE_CURRENT_LIST_DIR}/include/include.cmake)
if (OPT_TESTS)
include (${CMAKE_CURRENT_LIST_DIR}/test/test.cmake)
endif()
if (OPT_DEMOS)
include (${CMAKE_CURRENT_LIST_DIR}/demos/demos.cmake)
endif()
if (OPT_UNITTEST)
enable_testing()
include (${CMAKE_CURRENT_LIST_DIR}/unit_tests/unit_tests.cmake)
endif(OPT_UNITTEST)
include(CheckIncludeFile)
check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(stdlib.h HAVE_STDLIB_H)
check_include_file(stddef.h HAVE_STDDEF_H)
check_include_file(string.h HAVE_STRING_H)
check_include_file(memory.h HAVE_MEMORY_H)
check_include_file(stdbool.h HAVE_STDBOOL_H)
if (OPT_FORMAT_ABGR)
set(ENABLE_FORMAT_ABGR 1)
endif(OPT_FORMAT_ABGR)
if (OPT_FORMAT_ARGB)
set(ENABLE_FORMAT_ARGB 1)
endif(OPT_FORMAT_ARGB)
if (OPT_FORMAT_BGRA)
set(ENABLE_FORMAT_BGRA 1)
endif(OPT_FORMAT_BGRA)
if (OPT_FORMAT_RGBA)
set(ENABLE_FORMAT_RGBA 1)
endif(OPT_FORMAT_RGBA)
if (OPT_FORMAT_RGB)
set(ENABLE_FORMAT_RGB 1)
endif(OPT_FORMAT_RGB)
if (OPT_FORMAT_BGR)
set(ENABLE_FORMAT_BGR 1)
endif(OPT_FORMAT_BGR)
if (OPT_FORMAT_RGB565)
set(ENABLE_FORMAT_RGB565 1)
endif(OPT_FORMAT_RGB565)
if (OPT_FORMAT_RGB555)
set(ENABLE_FORMAT_RGB555 1)
endif(OPT_FORMAT_RGB555)
if (OPT_FORMAT_A8)
set(ENABLE_FORMAT_A8 1)
endif(OPT_FORMAT_A8)
if (OPT_FAST_COPY)
set(ENABLE_FAST_COPY 1)
endif(OPT_FAST_COPY)
if (OPT_FREE_TYPE2)
set(ENABLE_FREE_TYPE2 1)
endif(OPT_FREE_TYPE2)
if (OPT_FONT_CONFIG)
set(ENABLE_FONT_CONFIG 1)
endif(OPT_FONT_CONFIG)
if (OPT_LOW_MEMORY)
set(ENABLE_LOW_MEMORY 1)
endif(OPT_LOW_MEMORY)
if (OPT_SYSTEM_MALLOC)
set(ENABLE_SYSTEM_MALLOC 1)
endif(OPT_SYSTEM_MALLOC)
configure_file(
"${PROJECT_ROOT}/build/pconfig.h.in"
"${PROJECT_OUT}/include/pconfig.h"
)