summaryrefslogtreecommitdiffstats
path: root/share/CMakeLists.txt
blob: 1af97d48d7c4ab7e35a9113590491613d493d90e (plain)
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
# SPDX-License-Identifier: GPL-2.0-or-later
add_subdirectory(attributes)
add_subdirectory(branding)
add_subdirectory(examples)
add_subdirectory(filters)
add_subdirectory(fonts)
add_subdirectory(icons)
add_subdirectory(keys)
add_subdirectory(markers)
add_subdirectory(paint)
add_subdirectory(palettes)
add_subdirectory(screens)
add_subdirectory(symbols)
add_subdirectory(templates)
add_subdirectory(pixmaps)
add_subdirectory(tutorials)
add_subdirectory(ui)
add_subdirectory(doc)


# extensions (git submodule!)
install(DIRECTORY extensions DESTINATION ${INKSCAPE_SHARE_INSTALL}
    COMPONENT extensions
    PATTERN ".git*" EXCLUDE
    PATTERN "tests" EXCLUDE
    PATTERN "*.pyc" EXCLUDE
    PATTERN "print_win32_vector.*" EXCLUDE
    PATTERN "other/inkman" EXCLUDE
    PATTERN "other/*/*/tests" EXCLUDE
    PATTERN "other/*/*/MANIFEST.in" EXCLUDE
    PATTERN "other/*/*/requirements.txt" EXCLUDE
)

install(DIRECTORY extensions/other/inkman DESTINATION ${INKSCAPE_SHARE_INSTALL}/extensions/inkman/
    COMPONENT extension_manager
    PATTERN "tests" EXCLUDE
    PATTERN "MANIFEST.in" EXCLUDE
    PATTERN "requirements.txt" EXCLUDE
)

if(WIN32)
    install(
        FILES extensions/print_win32_vector.py extensions/print_win32_vector.inx
        DESTINATION ${INKSCAPE_SHARE_INSTALL}/extensions
        COMPONENT extensions
    )
  install(CODE
    "MESSAGE(\"Pre-compiling Python extensions to byte-code (.pyc files)\")
     execute_process(COMMAND \${CMAKE_INSTALL_PREFIX}/bin/python -m compileall -qq \${CMAKE_INSTALL_PREFIX}/${INKSCAPE_SHARE_INSTALL})"
    COMPONENT extensions)
endif()


# themes (git submodule!)
install(DIRECTORY themes DESTINATION ${INKSCAPE_SHARE_INSTALL}
    COMPONENT themes
    PATTERN ".git*" EXCLUDE
)


# appdata and desktop files, bash completions
if(UNIX)
  if (ENABLE_BINRELOC)
    set(INKSCAPE_ICONPATH "\${SNAP}/share/inkscape/branding/inkscape.svg")
  else()
    set(INKSCAPE_ICONPATH "org.inkscape.Inkscape")
  endif()
  set(INKSCAPE_MIMETYPE
	  "image/svg+xml"
	  "image/svg+xml-compressed"
	  "application/vnd.corel-draw"
	  "application/pdf"
	  "application/postscript"
	  "image/x-eps"
	  "application/illustrator"
	  "image/cgm"
	  "image/x-wmf"
	  "application/x-xccx"
	  "application/x-xcgm"
	  "application/x-xcdt"
	  "application/x-xsk1"
	  "application/x-xcmx"
	  "image/x-xcdr"
	  "application/visio"
	  "application/x-visio"
	  "application/vnd.visio"
	  "application/visio.drawing"
	  "application/vsd"
	  "application/x-vsd"
	  "image/x-vsd"
	  ""
  )

  configure_file(${CMAKE_SOURCE_DIR}/org.inkscape.Inkscape.desktop.template
    ${CMAKE_BINARY_DIR}/org.inkscape.Inkscape.desktop.in)

  if(ENABLE_NLS)
  add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/org.inkscape.Inkscape.desktop
    DEPENDS ${LANGUAGES}
    COMMAND ${GETTEXT_MSGFMT_EXECUTABLE}
    --desktop
    --template ${CMAKE_BINARY_DIR}/org.inkscape.Inkscape.desktop.in
    -d ${CMAKE_SOURCE_DIR}/po
    -o ${CMAKE_BINARY_DIR}/org.inkscape.Inkscape.desktop
    --keyword=Name
    --keyword=GenericName
    --keyword=X-GNOME-FullName
    --keyword=Comment
    --keyword=Keywords
    )
  add_custom_target(inkscape_desktop ALL DEPENDS ${CMAKE_BINARY_DIR}/org.inkscape.Inkscape.desktop)

  add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/org.inkscape.Inkscape.appdata.xml
    DEPENDS ${LANGUAGES}
    COMMAND ${GETTEXT_MSGFMT_EXECUTABLE}
    --xml
    --template ${CMAKE_SOURCE_DIR}/org.inkscape.Inkscape.appdata.xml.in
    -d ${CMAKE_SOURCE_DIR}/po -o ${CMAKE_BINARY_DIR}/org.inkscape.Inkscape.appdata.xml
    )
  add_custom_target(inkscape_appdata ALL DEPENDS ${CMAKE_BINARY_DIR}/org.inkscape.Inkscape.appdata.xml)
  else()
    configure_file(${CMAKE_SOURCE_DIR}/org.inkscape.Inkscape.appdata.xml.in ${CMAKE_BINARY_DIR}/org.inkscape.Inkscape.appdata.xml COPYONLY)
    configure_file(${CMAKE_BINARY_DIR}/org.inkscape.Inkscape.desktop.in
      ${CMAKE_BINARY_DIR}/org.inkscape.Inkscape.desktop COPYONLY)
  endif()


  install(FILES ${CMAKE_BINARY_DIR}/org.inkscape.Inkscape.desktop
    DESTINATION ${SHARE_INSTALL}/applications)
  install(FILES ${CMAKE_BINARY_DIR}/org.inkscape.Inkscape.appdata.xml
    DESTINATION ${SHARE_INSTALL}/metainfo)


  install(FILES
    bash-completion/completions/inkscape
    DESTINATION ${SHARE_INSTALL}/bash-completion/completions)

endif()