Mercurial > hg > orthanc-stone
annotate Resources/CMake/CairoConfiguration.cmake @ 1376:dc5acb03ad93 broker
Better source groups for SDL samples (retry)
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 22 Apr 2020 11:54:57 +0200 |
parents | 2d8ab34c8c91 |
children |
rev | line source |
---|---|
47 | 1 # Stone of Orthanc |
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
3 # Department, University Hospital of Liege, Belgium | |
1270
2d8ab34c8c91
upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
449
diff
changeset
|
4 # Copyright (C) 2017-2020 Osimis S.A., Belgium |
47 | 5 # |
6 # This program is free software: you can redistribute it and/or | |
7 # modify it under the terms of the GNU Affero General Public License | |
8 # as published by the Free Software Foundation, either version 3 of | |
9 # the License, or (at your option) any later version. | |
10 # | |
11 # This program is distributed in the hope that it will be useful, but | |
12 # WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
14 # Affero General Public License for more details. | |
15 # | |
16 # You should have received a copy of the GNU Affero General Public License | |
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
18 | |
19 | |
0 | 20 # ./configure --disable-pdf --disable-svg --disable-xlib --disable-xcb --disable-script --disable-ps --disable-ft --disable-fc --disable-png --disable-trace --disable-interpreter |
21 | |
22 | |
23 if (STATIC_BUILD OR NOT USE_SYSTEM_CAIRO) | |
171
01e32beee56c
upgrade to cairo 1.14.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
24 SET(CAIRO_SOURCES_DIR ${CMAKE_BINARY_DIR}/cairo-1.14.12) |
449
bb658baeb967
moving third-party dependencies to another server
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
25 SET(CAIRO_URL "http://orthanc.osimis.io/ThirdPartyDownloads/cairo-1.14.12.tar.xz") |
171
01e32beee56c
upgrade to cairo 1.14.12
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
26 SET(CAIRO_MD5 "9f0db9dbfca0966be8acd682e636d165") |
0 | 27 |
28 DownloadPackage(${CAIRO_MD5} ${CAIRO_URL} "${CAIRO_SOURCES_DIR}") | |
29 | |
30 file(COPY | |
31 ${CMAKE_CURRENT_LIST_DIR}/cairo-features.h | |
32 DESTINATION ${CAIRO_SOURCES_DIR}/src | |
33 ) | |
34 | |
35 set(CAIRO_SOURCES | |
36 ${CAIRO_SOURCES_DIR}/src/cairo-analysis-surface.c | |
37 ${CAIRO_SOURCES_DIR}/src/cairo-arc.c | |
38 ${CAIRO_SOURCES_DIR}/src/cairo-array.c | |
39 ${CAIRO_SOURCES_DIR}/src/cairo-atomic.c | |
40 ${CAIRO_SOURCES_DIR}/src/cairo-base64-stream.c | |
41 ${CAIRO_SOURCES_DIR}/src/cairo-base85-stream.c | |
42 ${CAIRO_SOURCES_DIR}/src/cairo-bentley-ottmann.c | |
43 ${CAIRO_SOURCES_DIR}/src/cairo-bentley-ottmann-rectangular.c | |
44 ${CAIRO_SOURCES_DIR}/src/cairo-bentley-ottmann-rectilinear.c | |
45 ${CAIRO_SOURCES_DIR}/src/cairo-botor-scan-converter.c | |
46 ${CAIRO_SOURCES_DIR}/src/cairo-boxes.c | |
47 ${CAIRO_SOURCES_DIR}/src/cairo-boxes-intersect.c | |
48 ${CAIRO_SOURCES_DIR}/src/cairo.c | |
49 ${CAIRO_SOURCES_DIR}/src/cairo-cache.c | |
50 ${CAIRO_SOURCES_DIR}/src/cairo-cff-subset.c | |
51 ${CAIRO_SOURCES_DIR}/src/cairo-clip-boxes.c | |
52 ${CAIRO_SOURCES_DIR}/src/cairo-clip.c | |
53 ${CAIRO_SOURCES_DIR}/src/cairo-clip-polygon.c | |
54 ${CAIRO_SOURCES_DIR}/src/cairo-clip-region.c | |
55 ${CAIRO_SOURCES_DIR}/src/cairo-clip-surface.c | |
56 ${CAIRO_SOURCES_DIR}/src/cairo-clip-tor-scan-converter.c | |
57 # ${CAIRO_SOURCES_DIR}/src/cairo-cogl-context.c | |
58 # ${CAIRO_SOURCES_DIR}/src/cairo-cogl-gradient.c | |
59 # ${CAIRO_SOURCES_DIR}/src/cairo-cogl-surface.c | |
60 # ${CAIRO_SOURCES_DIR}/src/cairo-cogl-utils.c | |
61 ${CAIRO_SOURCES_DIR}/src/cairo-color.c | |
62 ${CAIRO_SOURCES_DIR}/src/cairo-composite-rectangles.c | |
63 ${CAIRO_SOURCES_DIR}/src/cairo-compositor.c | |
64 ${CAIRO_SOURCES_DIR}/src/cairo-contour.c | |
65 ${CAIRO_SOURCES_DIR}/src/cairo-damage.c | |
66 ${CAIRO_SOURCES_DIR}/src/cairo-debug.c | |
67 ${CAIRO_SOURCES_DIR}/src/cairo-default-context.c | |
68 ${CAIRO_SOURCES_DIR}/src/cairo-deflate-stream.c | |
69 ${CAIRO_SOURCES_DIR}/src/cairo-device.c | |
70 # ${CAIRO_SOURCES_DIR}/src/cairo-directfb-surface.c | |
71 # ${CAIRO_SOURCES_DIR}/src/cairo-egl-context.c | |
72 ${CAIRO_SOURCES_DIR}/src/cairo-error.c | |
73 ${CAIRO_SOURCES_DIR}/src/cairo-fallback-compositor.c | |
74 ${CAIRO_SOURCES_DIR}/src/cairo-fixed.c | |
75 ${CAIRO_SOURCES_DIR}/src/cairo-font-face.c | |
76 ${CAIRO_SOURCES_DIR}/src/cairo-font-face-twin.c | |
77 ${CAIRO_SOURCES_DIR}/src/cairo-font-face-twin-data.c | |
78 ${CAIRO_SOURCES_DIR}/src/cairo-font-options.c | |
79 ${CAIRO_SOURCES_DIR}/src/cairo-freed-pool.c | |
80 ${CAIRO_SOURCES_DIR}/src/cairo-freelist.c | |
81 # ${CAIRO_SOURCES_DIR}/src/cairo-ft-font.c | |
82 # ${CAIRO_SOURCES_DIR}/src/cairo-gl-composite.c | |
83 # ${CAIRO_SOURCES_DIR}/src/cairo-gl-device.c | |
84 # ${CAIRO_SOURCES_DIR}/src/cairo-gl-dispatch.c | |
85 # ${CAIRO_SOURCES_DIR}/src/cairo-gl-glyphs.c | |
86 # ${CAIRO_SOURCES_DIR}/src/cairo-gl-gradient.c | |
87 # ${CAIRO_SOURCES_DIR}/src/cairo-gl-info.c | |
88 # ${CAIRO_SOURCES_DIR}/src/cairo-gl-msaa-compositor.c | |
89 # ${CAIRO_SOURCES_DIR}/src/cairo-gl-operand.c | |
90 # ${CAIRO_SOURCES_DIR}/src/cairo-gl-shaders.c | |
91 # ${CAIRO_SOURCES_DIR}/src/cairo-gl-source.c | |
92 # ${CAIRO_SOURCES_DIR}/src/cairo-gl-spans-compositor.c | |
93 # ${CAIRO_SOURCES_DIR}/src/cairo-gl-surface.c | |
94 # ${CAIRO_SOURCES_DIR}/src/cairo-gl-traps-compositor.c | |
95 # ${CAIRO_SOURCES_DIR}/src/cairo-glx-context.c | |
96 ${CAIRO_SOURCES_DIR}/src/cairo-gstate.c | |
97 ${CAIRO_SOURCES_DIR}/src/cairo-hash.c | |
98 ${CAIRO_SOURCES_DIR}/src/cairo-hull.c | |
99 ${CAIRO_SOURCES_DIR}/src/cairo-image-compositor.c | |
100 ${CAIRO_SOURCES_DIR}/src/cairo-image-info.c | |
101 ${CAIRO_SOURCES_DIR}/src/cairo-image-source.c | |
102 ${CAIRO_SOURCES_DIR}/src/cairo-image-surface.c | |
103 ${CAIRO_SOURCES_DIR}/src/cairo-line.c | |
104 ${CAIRO_SOURCES_DIR}/src/cairo-lzw.c | |
105 ${CAIRO_SOURCES_DIR}/src/cairo-mask-compositor.c | |
106 ${CAIRO_SOURCES_DIR}/src/cairo-matrix.c | |
107 ${CAIRO_SOURCES_DIR}/src/cairo-mempool.c | |
108 ${CAIRO_SOURCES_DIR}/src/cairo-mesh-pattern-rasterizer.c | |
109 ${CAIRO_SOURCES_DIR}/src/cairo-misc.c | |
110 ${CAIRO_SOURCES_DIR}/src/cairo-mono-scan-converter.c | |
111 ${CAIRO_SOURCES_DIR}/src/cairo-mutex.c | |
112 ${CAIRO_SOURCES_DIR}/src/cairo-no-compositor.c | |
113 ${CAIRO_SOURCES_DIR}/src/cairo-observer.c | |
114 # ${CAIRO_SOURCES_DIR}/src/cairo-os2-surface.c | |
115 ${CAIRO_SOURCES_DIR}/src/cairo-output-stream.c | |
116 ${CAIRO_SOURCES_DIR}/src/cairo-paginated-surface.c | |
117 ${CAIRO_SOURCES_DIR}/src/cairo-path-bounds.c | |
118 ${CAIRO_SOURCES_DIR}/src/cairo-path.c | |
119 ${CAIRO_SOURCES_DIR}/src/cairo-path-fill.c | |
120 ${CAIRO_SOURCES_DIR}/src/cairo-path-fixed.c | |
121 ${CAIRO_SOURCES_DIR}/src/cairo-path-in-fill.c | |
122 ${CAIRO_SOURCES_DIR}/src/cairo-path-stroke-boxes.c | |
123 ${CAIRO_SOURCES_DIR}/src/cairo-path-stroke.c | |
124 ${CAIRO_SOURCES_DIR}/src/cairo-path-stroke-polygon.c | |
125 ${CAIRO_SOURCES_DIR}/src/cairo-path-stroke-traps.c | |
126 ${CAIRO_SOURCES_DIR}/src/cairo-path-stroke-tristrip.c | |
127 ${CAIRO_SOURCES_DIR}/src/cairo-pattern.c | |
128 # ${CAIRO_SOURCES_DIR}/src/cairo-pdf-operators.c | |
129 # ${CAIRO_SOURCES_DIR}/src/cairo-pdf-shading.c | |
130 # ${CAIRO_SOURCES_DIR}/src/cairo-pdf-surface.c | |
131 ${CAIRO_SOURCES_DIR}/src/cairo-pen.c | |
132 # ${CAIRO_SOURCES_DIR}/src/cairo-png.c | |
133 ${CAIRO_SOURCES_DIR}/src/cairo-polygon.c | |
134 ${CAIRO_SOURCES_DIR}/src/cairo-polygon-intersect.c | |
135 ${CAIRO_SOURCES_DIR}/src/cairo-polygon-reduce.c | |
136 # ${CAIRO_SOURCES_DIR}/src/cairo-ps-surface.c | |
137 # ${CAIRO_SOURCES_DIR}/src/cairo-quartz-font.c | |
138 # ${CAIRO_SOURCES_DIR}/src/cairo-quartz-image-surface.c | |
139 # ${CAIRO_SOURCES_DIR}/src/cairo-quartz-surface.c | |
140 ${CAIRO_SOURCES_DIR}/src/cairo-raster-source-pattern.c | |
141 ${CAIRO_SOURCES_DIR}/src/cairo-recording-surface.c | |
142 ${CAIRO_SOURCES_DIR}/src/cairo-rectangle.c | |
143 ${CAIRO_SOURCES_DIR}/src/cairo-rectangular-scan-converter.c | |
144 ${CAIRO_SOURCES_DIR}/src/cairo-region.c | |
145 ${CAIRO_SOURCES_DIR}/src/cairo-rtree.c | |
146 ${CAIRO_SOURCES_DIR}/src/cairo-scaled-font.c | |
147 ${CAIRO_SOURCES_DIR}/src/cairo-scaled-font-subsets.c | |
148 # ${CAIRO_SOURCES_DIR}/src/cairo-script-surface.c | |
149 ${CAIRO_SOURCES_DIR}/src/cairo-shape-mask-compositor.c | |
150 ${CAIRO_SOURCES_DIR}/src/cairo-slope.c | |
151 ${CAIRO_SOURCES_DIR}/src/cairo-spans.c | |
152 ${CAIRO_SOURCES_DIR}/src/cairo-spans-compositor.c | |
153 ${CAIRO_SOURCES_DIR}/src/cairo-spline.c | |
154 ${CAIRO_SOURCES_DIR}/src/cairo-stroke-dash.c | |
155 ${CAIRO_SOURCES_DIR}/src/cairo-stroke-style.c | |
156 ${CAIRO_SOURCES_DIR}/src/cairo-surface.c | |
157 ${CAIRO_SOURCES_DIR}/src/cairo-surface-clipper.c | |
158 ${CAIRO_SOURCES_DIR}/src/cairo-surface-fallback.c | |
159 ${CAIRO_SOURCES_DIR}/src/cairo-surface-observer.c | |
160 ${CAIRO_SOURCES_DIR}/src/cairo-surface-offset.c | |
161 ${CAIRO_SOURCES_DIR}/src/cairo-surface-snapshot.c | |
162 ${CAIRO_SOURCES_DIR}/src/cairo-surface-subsurface.c | |
163 ${CAIRO_SOURCES_DIR}/src/cairo-surface-wrapper.c | |
164 # ${CAIRO_SOURCES_DIR}/src/cairo-svg-surface.c | |
165 # ${CAIRO_SOURCES_DIR}/src/cairo-tee-surface.c | |
166 ${CAIRO_SOURCES_DIR}/src/cairo-time.c | |
167 ${CAIRO_SOURCES_DIR}/src/cairo-tor22-scan-converter.c | |
168 ${CAIRO_SOURCES_DIR}/src/cairo-tor-scan-converter.c | |
169 ${CAIRO_SOURCES_DIR}/src/cairo-toy-font-face.c | |
170 ${CAIRO_SOURCES_DIR}/src/cairo-traps.c | |
171 ${CAIRO_SOURCES_DIR}/src/cairo-traps-compositor.c | |
172 ${CAIRO_SOURCES_DIR}/src/cairo-tristrip.c | |
173 ${CAIRO_SOURCES_DIR}/src/cairo-truetype-subset.c | |
174 ${CAIRO_SOURCES_DIR}/src/cairo-type1-fallback.c | |
175 ${CAIRO_SOURCES_DIR}/src/cairo-type1-glyph-names.c | |
176 ${CAIRO_SOURCES_DIR}/src/cairo-type1-subset.c | |
177 ${CAIRO_SOURCES_DIR}/src/cairo-type3-glyph-surface.c | |
178 ${CAIRO_SOURCES_DIR}/src/cairo-unicode.c | |
179 ${CAIRO_SOURCES_DIR}/src/cairo-user-font.c | |
180 ${CAIRO_SOURCES_DIR}/src/cairo-version.c | |
181 # ${CAIRO_SOURCES_DIR}/src/cairo-vg-surface.c | |
182 # ${CAIRO_SOURCES_DIR}/src/cairo-wgl-context.c | |
183 ${CAIRO_SOURCES_DIR}/src/cairo-wideint.c | |
184 # ${CAIRO_SOURCES_DIR}/src/cairo-xcb-connection.c | |
185 # ${CAIRO_SOURCES_DIR}/src/cairo-xcb-connection-core.c | |
186 # ${CAIRO_SOURCES_DIR}/src/cairo-xcb-connection-render.c | |
187 # ${CAIRO_SOURCES_DIR}/src/cairo-xcb-connection-shm.c | |
188 # ${CAIRO_SOURCES_DIR}/src/cairo-xcb-resources.c | |
189 # ${CAIRO_SOURCES_DIR}/src/cairo-xcb-screen.c | |
190 # ${CAIRO_SOURCES_DIR}/src/cairo-xcb-shm.c | |
191 # ${CAIRO_SOURCES_DIR}/src/cairo-xcb-surface.c | |
192 # ${CAIRO_SOURCES_DIR}/src/cairo-xcb-surface-core.c | |
193 # ${CAIRO_SOURCES_DIR}/src/cairo-xcb-surface-render.c | |
194 # ${CAIRO_SOURCES_DIR}/src/cairo-xlib-core-compositor.c | |
195 # ${CAIRO_SOURCES_DIR}/src/cairo-xlib-display.c | |
196 # ${CAIRO_SOURCES_DIR}/src/cairo-xlib-fallback-compositor.c | |
197 # ${CAIRO_SOURCES_DIR}/src/cairo-xlib-render-compositor.c | |
198 # ${CAIRO_SOURCES_DIR}/src/cairo-xlib-screen.c | |
199 # ${CAIRO_SOURCES_DIR}/src/cairo-xlib-source.c | |
200 # ${CAIRO_SOURCES_DIR}/src/cairo-xlib-surface.c | |
201 # ${CAIRO_SOURCES_DIR}/src/cairo-xlib-surface-shm.c | |
202 # ${CAIRO_SOURCES_DIR}/src/cairo-xlib-visual.c | |
203 # ${CAIRO_SOURCES_DIR}/src/cairo-xlib-xcb-surface.c | |
204 # ${CAIRO_SOURCES_DIR}/src/cairo-xml-surface.c | |
205 ) | |
206 | |
207 include_directories(${CAIRO_SOURCES_DIR}/src) | |
208 | |
209 set(CAIRO_DEFINITIONS "HAS_PIXMAN_GLYPHS=1") | |
210 | |
3
490347621f42
attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
211 if (${CMAKE_SYSTEM_NAME} STREQUAL "PNaCl") |
490347621f42
attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
212 # Disable vectorized instructions when targeting archicture-independent PNaCl |
0 | 213 set(CAIRO_DEFINITIONS "${CAIRO_DEFINITIONS};HAVE_STDINT_H=1;CAIRO_HAS_PTHREAD=1;HAVE_UINT64_T=1") |
214 | |
263
38c795cc7c48
primitives for android ndk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
196
diff
changeset
|
215 elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten" OR |
38c795cc7c48
primitives for android ndk
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
196
diff
changeset
|
216 ${CMAKE_SYSTEM_NAME} STREQUAL "Android") |
39 | 217 # Disable vectorized instructions and threading if targeting asm.js |
218 set(CAIRO_DEFINITIONS "${CAIRO_DEFINITIONS};HAVE_STDINT_H=1;CAIRO_HAS_PTHREAD=0;CAIRO_NO_MUTEX=1;HAVE_UINT64_T=1") | |
219 | |
3
490347621f42
attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
220 elseif (CMAKE_COMPILER_IS_GNUCXX OR |
490347621f42
attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
221 CMAKE_SYSTEM_NAME STREQUAL "Darwin") |
490347621f42
attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
222 |
490347621f42
attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
223 set(CAIRO_DEFINITIONS "${CAIRO_DEFINITIONS};HAVE_STDINT_H=1;CAIRO_HAS_PTHREAD=1;HAVE_UINT64_T=1;CAIRO_HAS_REAL_PTHREAD=1;HAVE_GCC_VECTOR_EXTENSIONS;HAVE_FLOAT128") |
490347621f42
attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
224 |
490347621f42
attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
225 if (CMAKE_COMPILER_IS_GNUCXX) |
490347621f42
attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
226 set_property( |
490347621f42
attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
227 SOURCE ${CAIRO_SOURCES} |
490347621f42
attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
228 PROPERTY COMPILE_FLAGS "-Wno-attributes" |
490347621f42
attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
229 ) |
0 | 230 endif() |
231 | |
232 elseif (MSVC) | |
3
490347621f42
attempt to build for OS X
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
233 # The cairo source code comes with built-in support for Visual Studio |
0 | 234 |
235 else() | |
236 message(FATAL_ERROR "Support your platform here") | |
237 | |
238 endif() | |
239 | |
24 | 240 |
241 if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") | |
242 # Explicitly request static building on Windows | |
243 add_definitions(-DCAIRO_WIN32_STATIC_BUILD=1) | |
244 endif() | |
245 | |
246 | |
0 | 247 set_property( |
248 SOURCE ${CAIRO_SOURCES} | |
249 PROPERTY COMPILE_DEFINITIONS "${CAIRO_DEFINITIONS}" | |
250 ) | |
251 | |
252 else() | |
253 | |
254 pkg_search_module(CAIRO REQUIRED cairo) | |
255 include_directories(${CAIRO_INCLUDE_DIRS}) | |
256 link_libraries(${CAIRO_LIBRARIES}) | |
257 endif() |