Code

Cmake: Fixed optional dependency linking
[inkscape.git] / src / CMakeLists.txt
1 SET(INKSCAPE_SRC)\r
2 \r
3 # A macro to replace slashes and spaces in a string with underscores\r
4 MACRO(SANITIZE_PATH _string_var)\r
5   STRING(REGEX REPLACE "[\\/ ]+" "_" ${_string_var} ${${_string_var}})\r
6 ENDMACRO(SANITIZE_PATH _string_var)\r
7 \r
8 # A macro to prepend a given string onto the beginning of each string in a list\r
9 MACRO(PREPEND _list _str)\r
10   SET(_temp_list ${${_list}})\r
11   SET(${_list})\r
12   FOREACH(x ${_temp_list})\r
13     SET(${_list} ${${_list}} ${_str}${x})\r
14   ENDFOREACH(x)\r
15 ENDMACRO(PREPEND _list _str)\r
16 \r
17 # All folder with CMakeLists.txt files (excluding internal libraries)\r
18 SET(srcfolders\r
19 algorithms\r
20 api\r
21 bind\r
22 debug
23 dialogs\r
24 display\r
25 dom\r
26 dom/io\r
27 dom/odf\r
28 dom/util\r
29 #dom/work\r
30 extension\r
31 #extension/dxf2svg\r
32 extension/implementation\r
33 extension/internal\r
34 extension/param\r
35 graphlayout\r
36 helper\r
37 inkjar\r
38 io\r
39 jabber_whiteboard\r
40 jabber_whiteboard/dialog\r
41 live_effects\r
42 live_effects/parameter\r
43 pedro\r
44 removeoverlap\r
45 svg\r
46 trace\r
47 trace/potrace\r
48 traits\r
49 ui/cache\r
50 ui\r
51 ui/dialog\r
52 ui/view\r
53 ui/widget\r
54 #utest\r
55 util\r
56 widgets\r
57 xml\r
58 )\r
59 \r
60 # 1) include each list file\r
61 # 2) grab the variable inside \r
62 # 3) prepend the full relative path to each file in list\r
63 # 4) append the list to INKSCAPE_SRC\r
64 FOREACH(dirlist ${srcfolders})\r
65   SET(_temp_dirlist "${dirlist}")\r
66   MESSAGE(STATUS "Processing ${CMAKE_CURRENT_SOURCE_DIR}/${dirlist}/CMakeLists.txt")\r
67   INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/${dirlist}/CMakeLists.txt)\r
68   SANITIZE_PATH(dirlist)\r
69   PREPEND(${dirlist}_SRC "${_temp_dirlist}/")\r
70   SET(INKSCAPE_SRC ${INKSCAPE_SRC} ${${dirlist}_SRC})\r
71 ENDFOREACH(dirlist)\r
72 \r
73 \r
74 # All directories containing lists files that describe building internal libraries\r
75 SET(libfolders
76 2geom\r
77 application\r
78 #dialogs\r
79 libavoid\r
80 libcola\r
81 libcroco\r
82 libgdl\r
83 libnr\r
84 libnrtype\r
85 libvpsc
86 livarot\r
87 )\r
88 \r
89 FOREACH(dirlist ${libfolders})\r
90   ADD_SUBDIRECTORY(${dirlist})\r
91 ENDFOREACH(dirlist)\r
92 \r
93 IF(WIN32)\r
94 SET(ONLY_WIN\r
95 registrytool.cpp
96 registrytool.h\r
97 #deptool.cpp
98 winmain.cpp\r
99 )\r
100 ELSEIF(WIN32)\r
101 SET(ONLY_WIN)\r
102 ENDIF(WIN32)\r
103 \r
104 SET(INKSCAPE_SRC\r
105 ${INKSCAPE_SRC}\r
106 approx-equal.h
107 arc-context.cpp
108 arc-context.h
109 attributes.cpp
110 attributes.h
111 attributes-test.h
112 axis-manip.cpp
113 axis-manip.h
114 bad-uri-exception.h
115 box3d-context.cpp
116 box3d-context.h
117 box3d.cpp
118 box3d.h
119 box3d-side.cpp
120 box3d-side.h
121 brokenimage.xpm
122 color.cpp
123 color.h
124 color-profile.cpp
125 color-profile-fns.h
126 color-profile.h
127 color-profile-test.h
128 color-rgba.h
129 composite-undo-stack-observer.cpp
130 composite-undo-stack-observer.h
131 conditions.cpp
132 conditions.h
133 conn-avoid-ref.cpp
134 conn-avoid-ref.h
135 connection-pool.h
136 connector-context.cpp
137 connector-context.h
138 console-output-undo-observer.cpp
139 console-output-undo-observer.h
140 context-fns.cpp
141 context-fns.h
142 decimal-round.h
143 deptool.cpp
144 desktop-affine.cpp
145 desktop-affine.h
146 desktop.cpp
147 desktop-events.cpp
148 desktop-events.h
149 desktop.h
150 desktop-handles.cpp
151 desktop-handles.h
152 desktop-style.cpp
153 desktop-style.h
154 device-manager.cpp
155 device-manager.h
156 dir-util.cpp
157 dir-util.h
158 dir-util-test.h
159 document.cpp
160 document.h
161 document-private.h
162 document-subset.cpp
163 document-subset.h
164 document-undo.cpp
165 doxygen-main.cpp
166 draw-anchor.cpp
167 draw-anchor.h
168 draw-context.cpp
169 draw-context.h
170 dropper-context.cpp
171 dropper-context.h
172 dyna-draw-context.cpp
173 dyna-draw-context.h
174 ege-adjustment-action.cpp
175 ege-adjustment-action.h
176 ege-color-prof-tracker.cpp
177 ege-color-prof-tracker.h
178 ege-output-action.cpp
179 ege-output-action.h
180 ege-select-one-action.cpp
181 ege-select-one-action.h
182 enums.h
183 eraser-context.cpp
184 eraser-context.h
185 event-context.cpp
186 event-context.h
187 event.h
188 event-log.cpp
189 event-log.h
190 extension
191 extract-uri.cpp
192 extract-uri.h
193 extract-uri-test.h
194 file.cpp
195 file.h
196 fill-or-stroke.h
197 filter-chemistry.cpp
198 filter-chemistry.h
199 filter-enums.cpp
200 filter-enums.h
201 fixes.cpp
202 flood-context.cpp
203 flood-context.h
204 fontsize-expansion.cpp
205 fontsize-expansion.h
206 forward.h
207 gc-alloc.h
208 gc-anchored.cpp
209 gc-anchored.h
210 gc-core.h
211 gc.cpp
212 gc-finalized.cpp
213 gc-finalized.h
214 gc-managed.h
215 gc-soft-ptr.h
216 gradient-chemistry.cpp
217 gradient-chemistry.h
218 gradient-context.cpp
219 gradient-context.h
220 gradient-drag.cpp
221 gradient-drag.h
222 guide-snapper.cpp
223 guide-snapper.h
224 help.cpp
225 helper-fns.h
226 help.h
227 icon-size.h
228 ige-mac-menu.c
229 ige-mac-menu.h
230 ink-action.cpp
231 ink-action.h
232 inkscape.cpp
233 inkscape.h
234 inkscape-private.h
235 inkscape.rc
236 inkscape-stock.cpp
237 inkscape-stock.h
238 inkscape_version.h.mingw
239 interface.cpp
240 interface.h
241 isinf.h
242 isnan.h
243 isnormal.h
244 jabber_whiteboard
245 knot.cpp
246 knot-enums.h
247 knot.h
248 knotholder.cpp
249 knot-holder-entity.h
250 knotholder.h
251 layer-fns.cpp
252 layer-fns.h
253 layer-manager.cpp
254 layer-manager.h
255 line-geometry.cpp
256 line-geometry.h
257 line-snapper.cpp
258 line-snapper.h
259 macros.h
260 main-cmdlineact.cpp
261 main-cmdlineact.h
262 main.cpp
263 marker.cpp
264 marker.h
265 media.cpp
266 media.h
267 memeq.h
268 menus-skeleton.h
269 message-context.cpp
270 message-context.h
271 message.h
272 message-stack.cpp
273 message-stack.h
274 mod360.cpp
275 mod360.h
276 mod360-test.h
277 modifier-fns.h
278 MultiPrinter.h
279 node-context.cpp
280 node-context.h
281 nodepath.cpp
282 nodepath.h
283 number-opt-number.h
284 object-edit.cpp
285 object-edit.h
286 object-hierarchy.cpp
287 object-hierarchy.h
288 object-snapper.cpp
289 object-snapper.h
290 path-chemistry.cpp
291 path-chemistry.h
292 path-prefix.h
293 pencil-context.cpp
294 pencil-context.h
295 pen-context.cpp
296 pen-context.h
297 persp3d.cpp
298 persp3d.h
299 persp3d-reference.cpp
300 persp3d-reference.h
301 perspective-line.cpp
302 perspective-line.h
303 plugin.def
304 preferences.cpp
305 preferences.h
306 preferences-skeleton.h
307 prefix.cpp
308 prefix.h
309 prefs-utils.cpp
310 prefs-utils.h
311 print.cpp
312 print.h
313 profile-manager.cpp
314 profile-manager.h
315 proj_pt.cpp
316 proj_pt.h
317 PylogFormatter.h
318 rect-context.cpp
319 rect-context.h
320 remove-last.h
321 require-config.h
322 round.h
323 round-test.h
324 rubberband.cpp
325 rubberband.h
326 satisfied-guide-cns.cpp
327 satisfied-guide-cns.h
328 selcue.cpp
329 selcue.h
330 select-context.cpp
331 select-context.h
332 selection-chemistry.cpp
333 selection-chemistry.h
334 selection.cpp
335 selection-describer.cpp
336 selection-describer.h
337 selection.h
338 selfname.tpl
339 seltrans.cpp
340 seltrans.h
341 seltrans-handles.cpp
342 seltrans-handles.h
343 shape-editor.cpp
344 shape-editor.h
345 shortcuts.cpp
346 shortcuts.h
347 snap.cpp
348 snap.h
349 snapped-line.cpp
350 snapped-line.h
351 snapped-point.cpp
352 snapped-point.h
353 snapper.cpp
354 snapper.h
355 sp-anchor.cpp
356 sp-anchor.h
357 sp-animation.cpp
358 sp-animation.h
359 sp-clippath.cpp
360 sp-clippath.h
361 sp-conn-end.cpp
362 sp-conn-end.h
363 sp-conn-end-pair.cpp
364 sp-conn-end-pair.h
365 sp-cursor.cpp
366 sp-cursor.h
367 sp-defs.cpp
368 sp-defs.h
369 sp-ellipse.cpp
370 sp-ellipse.h
371 sp-feblend.cpp
372 sp-feblend-fns.h
373 sp-feblend.h
374 sp-fecolormatrix.cpp
375 sp-fecolormatrix-fns.h
376 sp-fecolormatrix.h
377 sp-fecomponenttransfer.cpp
378 sp-fecomponenttransfer-fns.h
379 sp-fecomponenttransfer-funcnode.cpp
380 sp-fecomponenttransfer-funcnode.h
381 sp-fecomponenttransfer.h
382 sp-fecomposite.cpp
383 sp-fecomposite-fns.h
384 sp-fecomposite.h
385 sp-feconvolvematrix.cpp
386 sp-feconvolvematrix-fns.h
387 sp-feconvolvematrix.h
388 sp-fediffuselighting.cpp
389 sp-fediffuselighting-fns.h
390 sp-fediffuselighting.h
391 sp-fedisplacementmap.cpp
392 sp-fedisplacementmap-fns.h
393 sp-fedisplacementmap.h
394 sp-fedistantlight.cpp
395 sp-fedistantlight.h
396 sp-feflood.cpp
397 sp-feflood-fns.h
398 sp-feflood.h
399 sp-feimage.cpp
400 sp-feimage-fns.h
401 sp-feimage.h
402 sp-femerge.cpp
403 sp-femerge-fns.h
404 sp-femerge.h
405 sp-femergenode.cpp
406 sp-femergenode.h
407 sp-femorphology.cpp
408 sp-femorphology-fns.h
409 sp-femorphology.h
410 sp-feoffset.cpp
411 sp-feoffset-fns.h
412 sp-feoffset.h
413 sp-fepointlight.cpp
414 sp-fepointlight.h
415 sp-fespecularlighting.cpp
416 sp-fespecularlighting-fns.h
417 sp-fespecularlighting.h
418 sp-fespotlight.cpp
419 sp-fespotlight.h
420 sp-fetile.cpp
421 sp-fetile-fns.h
422 sp-fetile.h
423 sp-feturbulence.cpp
424 sp-feturbulence-fns.h
425 sp-feturbulence.h
426 sp-filter.cpp
427 sp-filter-fns.h
428 sp-filter.h
429 sp-filter-primitive.cpp
430 sp-filter-primitive.h
431 sp-filter-reference.cpp
432 sp-filter-reference.h
433 sp-filter-units.h
434 sp-flowdiv.cpp
435 sp-flowdiv.h
436 sp-flowregion.cpp
437 sp-flowregion.h
438 sp-flowtext.cpp
439 sp-flowtext.h
440 sp-font.cpp
441 sp-font.h
442 sp-gaussian-blur.cpp
443 sp-gaussian-blur-fns.h
444 sp-gaussian-blur.h
445 sp-glyph.cpp
446 sp-glyph.h
447 sp-gradient.cpp
448 sp-gradient-fns.h
449 sp-gradient.h
450 sp-gradient-reference.cpp
451 sp-gradient-reference.h
452 sp-gradient-spread.h
453 sp-gradient-test.h
454 sp-gradient-units.h
455 sp-gradient-vector.h
456 sp-guide-attachment.h
457 sp-guide-constraint.h
458 sp-guide.cpp
459 sp-guide.h
460 sp-image.cpp
461 sp-image.h
462 spiral-context.cpp
463 spiral-context.h
464 sp-item.cpp
465 sp-item-group.cpp
466 sp-item-group.h
467 sp-item.h
468 sp-item-notify-moveto.cpp
469 sp-item-notify-moveto.h
470 sp-item-rm-unsatisfied-cns.cpp
471 sp-item-rm-unsatisfied-cns.h
472 sp-item-transform.cpp
473 sp-item-transform.h
474 sp-item-update-cns.cpp
475 sp-item-update-cns.h
476 sp-linear-gradient-fns.h
477 sp-linear-gradient.h
478 sp-line.cpp
479 sp-line.h
480 splivarot.cpp
481 splivarot.h
482 sp-lpe-item.cpp
483 sp-lpe-item.h
484 sp-marker-loc.h
485 sp-mask.cpp
486 sp-mask.h
487 sp-metadata.cpp
488 sp-metadata.h
489 sp-metric.h
490 sp-metrics.cpp
491 sp-metrics.h
492 sp-missing-glyph.cpp
493 sp-missing-glyph.h
494 sp-namedview.cpp
495 sp-namedview.h
496 sp-object.cpp
497 sp-object-group.cpp
498 sp-object-group.h
499 sp-object.h
500 sp-object-repr.cpp
501 sp-object-repr.h
502 sp-offset.cpp
503 sp-offset.h
504 sp-paint-server.cpp
505 sp-paint-server.h
506 sp-path.cpp
507 sp-path.h
508 sp-pattern.cpp
509 sp-pattern.h
510 sp-polygon.cpp
511 sp-polygon.h
512 sp-polyline.cpp
513 sp-polyline.h
514 sp-radial-gradient-fns.h
515 sp-radial-gradient.h
516 sp-rect.cpp
517 sp-rect.h
518 sp-root.cpp
519 sp-root.h
520 sp-shape.cpp
521 sp-shape.h
522 sp-skeleton.cpp
523 sp-skeleton.h
524 sp-spiral.cpp
525 sp-spiral.h
526 sp-star.cpp
527 sp-star.h
528 sp-stop-fns.h
529 sp-stop.h
530 sp-string.cpp
531 sp-string.h
532 sp-style-elem.cpp
533 sp-style-elem.h
534 sp-style-elem-test.h
535 sp-switch.cpp
536 sp-switch.h
537 sp-symbol.cpp
538 sp-symbol.h
539 sp-text.cpp
540 sp-text.h
541 sp-textpath.h
542 sp-tref.cpp
543 sp-tref.h
544 sp-tref-reference.cpp
545 sp-tref-reference.h
546 sp-tspan.cpp
547 sp-tspan.h
548 sp-use.cpp
549 sp-use.h
550 sp-use-reference.cpp
551 sp-use-reference.h
552 star-context.cpp
553 star-context.h
554 streams-gzip.cpp
555 streams-gzip.h
556 streams-handles.cpp
557 streams-handles.h
558 streams-jar.cpp
559 streams-jar.h
560 streams-zlib.cpp
561 streams-zlib.h
562 streq.h
563 strneq.h
564 style.cpp
565 style.h
566 style-test.cpp
567 style-test.h
568 svg-profile.h
569 svg-view.cpp
570 svg-view.h
571 svg-view-widget.cpp
572 svg-view-widget.h
573 syseq.h
574 test-helpers.h
575 text-chemistry.cpp
576 text-chemistry.h
577 text-context.cpp
578 text-context.h
579 text-editing.cpp
580 text-editing.h
581 text-tag-attributes.h
582 tools-switch.cpp
583 tools-switch.h
584 transf_mat_3x4.cpp
585 transf_mat_3x4.h
586 TRPIFormatter.h
587 tweak-context.cpp
588 tweak-context.h
589 undo-stack-observer.h
590 unit-constants.h
591 uri.cpp
592 uri.h
593 uri-references.cpp
594 uri-references.h
595 vanishing-point.cpp
596 vanishing-point.h
597 verbs.cpp
598 verbs.h
599 verbs-test.h
600 version.cpp
601 version.h
602 zoom-context.cpp
603 zoom-context.h\r
604 ${ONLY_WIN}
605 \r
606 )\r
607 \r
608 # make executable for INKSCAPE\r
609 ADD_EXECUTABLE(inkscape ${INKSCAPE_SRC})\r
610 TARGET_LINK_LIBRARIES(inkscape\r
611         "${INKSCAPE_LINK_FLAGS}" 2geom avoid cola croco gdl nr nrtype vpsc livarot\r
614 # make executable for INKVIEW
615 ADD_EXECUTABLE(inkview inkview.cpp)
616 TARGET_LINK_LIBRARIES(inkview\r
617         "${INKSCAPE_LINK_FLAGS}" 2geom avoid cola croco gdl nr nrtype vpsc livarot\r
618 )\r
619 #INSTALL(TARGETS INKSCAPE\r
620 #  RUNTIME DESTINATION bin\r
621 #  LIBRARY DESTINATION lib\r
622 #  ARCHIVE DESTINATION lib\r
623 #)\r
624 \r
625 #FILE(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*.h")\r
626 #INSTALL(FILES ${files} DESTINATION include/INKSCAPE/INKSCAPE)\r
627 \r
628 #CONFIGURE_FILE( ${CMAKE_SOURCE_DIR}/INKSCAPE.pc.in\r
629 #                ${CMAKE_BINARY_DIR}/INKSCAPE.pc @ONLY IMMEDIATE )\r
630 #INSTALL(FILES "${CMAKE_BINARY_DIR}/INKSCAPE.pc" DESTINATION lib/pkgconfig)\r