Source/External/freetype/CMakeLists.txt

Mon, 12 Jul 2021 17:44:02 +0300

author
dogukangulyasar
date
Mon, 12 Jul 2021 17:44:02 +0300
branch
4.x-dev
changeset 1713
80875b924288
parent 1609
4bb6c507b881
permissions
-rw-r--r--

* Edited readme Ubuntu 18.04 dependencies.

1573
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
1 cmake_minimum_required(VERSION 2.8.12)
1609
4bb6c507b881 * Missing freetype files
yakupbeyoglu
parents: 1588
diff changeset
2 include(CheckIncludeFile)
1573
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
3 if (NOT CMAKE_VERSION VERSION_LESS 3.3)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
4 # Allow symbol visibility settings also on static libraries. CMake < 3.3
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
5 # only sets the property on a shared library build.
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
6 cmake_policy(SET CMP0063 NEW)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
7 endif ()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
8
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
9 set(BUILD_SHARED_LIBS OFF)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
10
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
11 project(freetype C)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
12
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
13 set(VERSION_MAJOR "2")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
14 set(VERSION_MINOR "10")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
15 set(VERSION_PATCH "4")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
16
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
17 # Add local cmake modules
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
18 list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/builds/cmake)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
19
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
20 # Create the configuration file
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
21 if (UNIX)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
22 check_include_file("unistd.h" HAVE_UNISTD_H)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
23 check_include_file("fcntl.h" HAVE_FCNTL_H)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
24
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
25 file(READ "${PROJECT_SOURCE_DIR}/builds/unix/ftconfig.h.in"
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
26 FTCONFIG_H)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
27 if (HAVE_UNISTD_H)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
28 string(REGEX REPLACE
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
29 "#undef +(HAVE_UNISTD_H)" "#define \\1 1"
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
30 FTCONFIG_H "${FTCONFIG_H}")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
31 endif ()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
32 if (HAVE_FCNTL_H)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
33 string(REGEX REPLACE
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
34 "#undef +(HAVE_FCNTL_H)" "#define \\1 1"
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
35 FTCONFIG_H "${FTCONFIG_H}")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
36 endif ()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
37 else ()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
38 file(READ "${PROJECT_SOURCE_DIR}/include/freetype/config/ftconfig.h"
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
39 FTCONFIG_H)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
40 endif ()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
41
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
42 set(FTCONFIG_H_NAME "${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
43 if (EXISTS "${FTCONFIG_H_NAME}")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
44 file(READ "${FTCONFIG_H_NAME}" ORIGINAL_FTCONFIG_H)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
45 else ()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
46 set(ORIGINAL_FTCONFIG_H "")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
47 endif ()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
48 if (NOT (ORIGINAL_FTCONFIG_H STREQUAL FTCONFIG_H))
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
49 file(WRITE "${FTCONFIG_H_NAME}" "${FTCONFIG_H}")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
50 endif ()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
51
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
52
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
53 # Create the options file
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
54 file(READ "${PROJECT_SOURCE_DIR}/include/freetype/config/ftoption.h"
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
55 FTOPTION_H)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
56 if (ZLIB_FOUND)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
57 string(REGEX REPLACE
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
58 "/\\* +(#define +FT_CONFIG_OPTION_SYSTEM_ZLIB) +\\*/" "\\1"
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
59 FTOPTION_H "${FTOPTION_H}")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
60 endif ()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
61 if (BZIP2_FOUND)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
62 string(REGEX REPLACE
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
63 "/\\* +(#define +FT_CONFIG_OPTION_USE_BZIP2) +\\*/" "\\1"
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
64 FTOPTION_H "${FTOPTION_H}")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
65 endif ()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
66 if (PNG_FOUND)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
67 string(REGEX REPLACE
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
68 "/\\* +(#define +FT_CONFIG_OPTION_USE_PNG) +\\*/" "\\1"
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
69 FTOPTION_H "${FTOPTION_H}")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
70 endif ()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
71 if (HARFBUZZ_FOUND)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
72 string(REGEX REPLACE
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
73 "/\\* +(#define +FT_CONFIG_OPTION_USE_HARFBUZZ) +\\*/" "\\1"
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
74 FTOPTION_H "${FTOPTION_H}")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
75 endif ()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
76 if (BROTLIDEC_FOUND)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
77 string(REGEX REPLACE
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
78 "/\\* +(#define +FT_CONFIG_OPTION_USE_BROTLI) +\\*/" "\\1"
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
79 FTOPTION_H "${FTOPTION_H}")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
80 endif ()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
81
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
82 set(FTOPTION_H_NAME "${PROJECT_BINARY_DIR}/include/freetype/config/ftoption.h")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
83 if (EXISTS "${FTOPTION_H_NAME}")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
84 file(READ "${FTOPTION_H_NAME}" ORIGINAL_FTOPTION_H)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
85 else ()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
86 set(ORIGINAL_FTOPTION_H "")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
87 endif ()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
88 if (NOT (ORIGINAL_FTOPTION_H STREQUAL FTOPTION_H))
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
89 file(WRITE "${FTOPTION_H_NAME}" "${FTOPTION_H}")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
90 endif ()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
91
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
92
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
93 file(GLOB PUBLIC_HEADERS "include/ft2build.h" "include/freetype/*.h")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
94 file(GLOB PUBLIC_CONFIG_HEADERS "include/freetype/config/*.h")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
95 file(GLOB PRIVATE_HEADERS "include/freetype/internal/*.h")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
96
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
97
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
98 set(BASE_SRCS
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
99 src/autofit/autofit.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
100 src/base/ftbase.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
101 src/base/ftbbox.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
102 src/base/ftbdf.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
103 src/base/ftbitmap.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
104 src/base/ftcid.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
105 src/base/ftfstype.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
106 src/base/ftgasp.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
107 src/base/ftglyph.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
108 src/base/ftgxval.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
109 src/base/ftinit.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
110 src/base/ftmm.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
111 src/base/ftotval.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
112 src/base/ftpatent.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
113 src/base/ftpfr.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
114 src/base/ftstroke.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
115 src/base/ftsynth.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
116 src/base/fttype1.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
117 src/base/ftwinfnt.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
118 src/bdf/bdf.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
119 src/bzip2/ftbzip2.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
120 src/cache/ftcache.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
121 src/cff/cff.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
122 src/cid/type1cid.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
123 src/gzip/ftgzip.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
124 src/lzw/ftlzw.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
125 src/pcf/pcf.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
126 src/pfr/pfr.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
127 src/psaux/psaux.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
128 src/pshinter/pshinter.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
129 src/psnames/psnames.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
130 src/raster/raster.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
131 src/sfnt/sfnt.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
132 src/smooth/smooth.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
133 src/truetype/truetype.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
134 src/type1/type1.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
135 src/type42/type42.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
136 src/winfonts/winfnt.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
137 )
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
138
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
139 if (UNIX)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
140 list(APPEND BASE_SRCS "builds/unix/ftsystem.c")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
141 else ()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
142 list(APPEND BASE_SRCS "src/base/ftsystem.c")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
143 endif ()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
144
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
145 if (WIN32)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
146 enable_language(RC)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
147 list(APPEND BASE_SRCS builds/windows/ftdebug.c
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
148 src/base/ftver.rc)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
149 elseif (WINCE)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
150 list(APPEND BASE_SRCS builds/wince/ftdebug.c)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
151 else ()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
152 list(APPEND BASE_SRCS src/base/ftdebug.c)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
153 endif ()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
154
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
155 set(CMAKE_DEBUG_POSTFIX d)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
156
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
157
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
158 add_library(freetype STATIC
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
159 ${PUBLIC_HEADERS}
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
160 ${PUBLIC_CONFIG_HEADERS}
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
161 ${PRIVATE_HEADERS}
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
162 ${BASE_SRCS}
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
163 )
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
164
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
165 set_target_properties(
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
166 freetype PROPERTIES
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
167 C_VISIBILITY_PRESET hidden)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
168
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
169 target_compile_definitions(
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
170 freetype PRIVATE FT2_BUILD_LIBRARY)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
171
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
172 if (WIN32)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
173 target_compile_definitions(
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
174 freetype PRIVATE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
175 if (BUILD_SHARED_LIBS)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
176 target_compile_definitions(
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
177 freetype PRIVATE DLL_EXPORT)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
178 endif ()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
179 endif ()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
180
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
181 if (BUILD_SHARED_LIBS)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
182 set_target_properties(freetype PROPERTIES
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
183 VERSION ${LIBRARY_VERSION}
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
184 SOVERSION ${LIBRARY_SOVERSION})
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
185 endif ()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
186
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
187 # Pick up ftconfig.h and ftoption.h generated above, first.
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
188 target_include_directories(
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
189 freetype
1588
fad9cb4ad21a * FreeType cmake fixes
cemkalyoncu
parents: 1573
diff changeset
190 PRIVATE
1573
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
191 $<INSTALL_INTERFACE:include/freetype2>
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
192 $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
193 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
194 PRIVATE
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
195 ${CMAKE_CURRENT_BINARY_DIR}/include
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
196 ${CMAKE_CURRENT_SOURCE_DIR}/include
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
197
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
198 # Make <ftconfig.h> available for builds/unix/ftsystem.c.
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
199 ${CMAKE_CURRENT_BINARY_DIR}/include/freetype/config
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
200 )
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
201
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
202
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
203
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
204
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
205 IF(WIN32)
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
206 set_target_properties(freetype PROPERTIES
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
207 DEBUG_OUTPUT_NAME freetype_d
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
208 RELWITHDEBINFO_OUTPUT_NAME freetype_rd
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
209 MINSIZEREL_OUTPUT_NAME freetype_min
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
210 )
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
211 ENDIF()
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
212
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
213 install(TARGETS freetype
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
214 EXPORT GorgonTargets
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
215 ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
1588
fad9cb4ad21a * FreeType cmake fixes
cemkalyoncu
parents: 1573
diff changeset
216 #PUBLIC_HEADER DESTINATION "${INSTALL_INCLUDE_DIR}/Gorgon"
1573
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
217 )
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
218
1588
fad9cb4ad21a * FreeType cmake fixes
cemkalyoncu
parents: 1573
diff changeset
219 message(${INSTALL_INCLUDE_DIR})
fad9cb4ad21a * FreeType cmake fixes
cemkalyoncu
parents: 1573
diff changeset
220
1573
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
221 export(TARGETS freetype APPEND FILE "${PROJECT_PACKAGE_DIR}/GorgonTargets.cmake")
bec9b011ecb6 * FreeType builtin compilation
cemkalyoncu
parents:
diff changeset
222

mercurial