~ci-train-bot/content-hub/content-hub-ubuntu-zesty-2547

« back to all changes in this revision

Viewing changes to src/com/ubuntu/content/CMakeLists.txt

  • Committer: Bileto Bot
  • Author(s): William Hua
  • Date: 2016-12-01 18:22:07 UTC
  • mfrom: (306.1.5 content-hub-glib-2)
  • Revision ID: ci-train-bot@canonical.com-20161201182207-2nufa4c17pti1x4d
Add GLib bindings (LP: #1624437) (LP: #1624437)

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
  ${UBUNTU_DOWNLOAD_MANAGER_INCLUDE_DIRS}
29
29
  ${NOTIFY_INCLUDE_DIRS}
30
30
  ${APPARMOR_INCLUDE_DIRS}
 
31
  ${GLIB_INCLUDE_DIRS}
 
32
  ${GIO_INCLUDE_DIRS}
31
33
)
32
34
 
33
35
qt5_add_dbus_interface(
120
122
    ${APPARMOR_LDFLAGS}
121
123
)
122
124
 
123
 
install(
124
 
  TARGETS content-hub
 
125
find_program(
 
126
  GDBUS_CODEGEN
 
127
  gdbus-codegen
 
128
)
 
129
 
 
130
set(
 
131
  DBUS_XML
 
132
  ${CMAKE_CURRENT_SOURCE_DIR}/detail/com.ubuntu.content.Handler.xml
 
133
  ${CMAKE_CURRENT_SOURCE_DIR}/detail/com.ubuntu.content.Paste.xml
 
134
  ${CMAKE_CURRENT_SOURCE_DIR}/detail/com.ubuntu.content.Service.xml
 
135
  ${CMAKE_CURRENT_SOURCE_DIR}/detail/com.ubuntu.content.Transfer.xml
 
136
)
 
137
 
 
138
set(
 
139
  DBUS_ANNOTATIONS
 
140
  --annotate com.ubuntu.content.dbus.Paste.Charge\(\)[mimeData] org.gtk.GDBus.C.ForceGVariant true
 
141
  --annotate com.ubuntu.content.dbus.Paste.MimeData\(\)[mimeData] org.gtk.GDBus.C.ForceGVariant true
 
142
  --annotate com.ubuntu.content.dbus.Service.CreatePaste\(\)[mimeData] org.gtk.GDBus.C.ForceGVariant true
 
143
  --annotate com.ubuntu.content.dbus.Service.GetLatestPasteData\(\)[mimeData] org.gtk.GDBus.C.ForceGVariant true
 
144
  --annotate com.ubuntu.content.dbus.Service.GetPasteData\(\)[mimeData] org.gtk.GDBus.C.ForceGVariant true
 
145
)
 
146
 
 
147
add_custom_command(
 
148
  OUTPUT glib/content-hub-glib.h glib/content-hub-glib.c
 
149
  COMMAND ${CMAKE_COMMAND} -E make_directory glib
 
150
  COMMAND ${GDBUS_CODEGEN}
 
151
          --interface-prefix com.ubuntu.content.dbus
 
152
          --generate-c-code glib/content-hub-glib
 
153
          --c-namespace ContentHub
 
154
          ${DBUS_ANNOTATIONS}
 
155
          ${DBUS_XML}
 
156
  DEPENDS ${DBUS_XML}
 
157
  VERBATIM
 
158
)
 
159
 
 
160
add_library(
 
161
  content-hub-glib SHARED
 
162
  glib/content-hub-glib.h
 
163
  glib/content-hub-glib.c
 
164
)
 
165
 
 
166
target_link_libraries(
 
167
  content-hub-glib
 
168
  ${GIO_LIBRARIES}
 
169
)
 
170
 
 
171
set_target_properties(
 
172
  content-hub-glib
 
173
  PROPERTIES
 
174
  VERSION ${CONTENT_HUB_VERSION_MAJOR}.${CONTENT_HUB_VERSION_MINOR}.${CONTENT_HUB_VERSION_PATCH}
 
175
  SOVERSION ${CONTENT_HUB_VERSION_MAJOR}
 
176
)
 
177
 
 
178
install(
 
179
  FILES ${CMAKE_CURRENT_BINARY_DIR}/glib/content-hub-glib.h
 
180
  DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/com/ubuntu/content/glib
 
181
)
 
182
 
 
183
install(
 
184
  TARGETS content-hub content-hub-glib
125
185
  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
126
186
  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
127
187
)