~dobey/ubuntu-app-launch/ship-app-mock

144.4.2 by Ted Gould
Build system and file moves
1
project(ubuntu-app-launch C CXX)
33.5.3 by Ted Gould
Base CMake stuff
2
cmake_minimum_required(VERSION 2.8.9)
3
237.2.3 by Ted Gould
Add in a bunch of generation
4
##########################
5
# Version Info
6
##########################
7
287.1.1 by Ken VanDine
New upstream version
8
set(API_VERSION 3)
9
set(ABI_VERSION 4)
237.2.3 by Ted Gould
Add in a bunch of generation
10
11
##########################
12
# Options
13
##########################
14
62.1.47 by Ted Gould
Setting up a test directory
15
option (enable_tests "Build tests" ON)
16
33.5.3 by Ted Gould
Base CMake stuff
17
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}")
18
19
set(PACKAGE ${CMAKE_PROJECT_NAME})
20
237.2.3 by Ted Gould
Add in a bunch of generation
21
##########################
22
# Dependent Packages
23
##########################
24
33.5.3 by Ted Gould
Base CMake stuff
25
find_package(PkgConfig REQUIRED)
104.1.4 by Ted Gould
Making sure we find GObject introspection
26
find_package(GObjectIntrospection REQUIRED)
33.5.3 by Ted Gould
Base CMake stuff
27
include(GNUInstallDirs)
28
include(CheckIncludeFile)
29
include(CheckFunctionExists)
30
include(UseGlibGeneration)
31
include(UseGdbusCodegen)
32
include(UseConstantBuilder)
87.2.2 by Ted Gould
Getting a simple tracepoint building
33
include(UseLttngGenTp)
33.5.3 by Ted Gould
Base CMake stuff
34
35
# Workaround for libexecdir on debian
36
if (EXISTS "/etc/debian_version") 
37
  set(CMAKE_INSTALL_LIBEXECDIR ${CMAKE_INSTALL_LIBDIR})
38
  set(CMAKE_INSTALL_FULL_LIBEXECDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBEXECDIR}")
39
endif()
40
33.5.5 by Ted Gould
Converting from Make to CMake
41
set(pkglibexecdir "${CMAKE_INSTALL_FULL_LIBEXECDIR}/${CMAKE_PROJECT_NAME}")
184.1.3 by Ted Gould
Merging build systems
42
set(CMAKE_INSTALL_PKGLIBEXECDIR "${CMAKE_INSTALL_LIBEXECDIR}/${CMAKE_PROJECT_NAME}")
43
set(CMAKE_INSTALL_FULL_PKGLIBEXECDIR "${CMAKE_INSTALL_FULL_LIBEXECDIR}/${CMAKE_PROJECT_NAME}")
44
set(CMAKE_INSTALL_FULL_PKGDATADIR "${CMAKE_INSTALL_FULL_DATADIR}/${CMAKE_PROJECT_NAME}")
33.5.5 by Ted Gould
Converting from Make to CMake
45
80.4.2 by Ted Gould
Get the triplet from dpkg-architecture
46
execute_process(COMMAND dpkg-architecture -qDEB_BUILD_MULTIARCH
152.1.4 by Ted Gould
Set the correct variable name
47
	OUTPUT_VARIABLE UBUNTU_APP_LAUNCH_ARCH
80.4.2 by Ted Gould
Get the triplet from dpkg-architecture
48
	OUTPUT_STRIP_TRAILING_WHITESPACE
49
)
144.4.2 by Ted Gould
Build system and file moves
50
set(ubuntu_app_launch_arch "${UBUNTU_APP_LAUNCH_ARCH}")
80.4.2 by Ted Gould
Get the triplet from dpkg-architecture
51
230.10.24 by Ted Gould
Switch to add_compile_options()
52
add_compile_options(
53
# Because we believe in quality
54
	-Wall -Werror
55
	-g
56
	-pthread
57
)
33.5.3 by Ted Gould
Base CMake stuff
58
230.10.35 by Ted Gould
Remove the generator based flags
59
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
60
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
61
33.5.5 by Ted Gould
Converting from Make to CMake
62
enable_testing()
63
33.5.3 by Ted Gould
Base CMake stuff
64
pkg_check_modules(GLIB2 REQUIRED glib-2.0)
65
include_directories(${GLIB2_INCLUDE_DIRS})
66
67
pkg_check_modules(GOBJECT2 REQUIRED gobject-2.0)
68
include_directories(${GOBJECT2_INCLUDE_DIRS})
69
193.1.7 by Ted Gould
Stealing the demangler from pay-service
70
pkg_check_modules(GIO2 REQUIRED gio-2.0 gio-unix-2.0)
33.5.3 by Ted Gould
Base CMake stuff
71
include_directories(${GIO2_INCLUDE_DIRS})
72
265.2.1 by Ted Gould
Removing JSON-GLib version cruft
73
pkg_check_modules(JSONGLIB REQUIRED json-glib-1.0>=1.1.2)
33.5.3 by Ted Gould
Base CMake stuff
74
include_directories(${JSONGLIB_INCLUDE_DIRS})
75
80.3.3 by Ted Gould
Switch to libZG v2
76
pkg_check_modules(ZEITGEIST REQUIRED zeitgeist-2.0)
33.5.3 by Ted Gould
Base CMake stuff
77
include_directories(${ZEITGEIST_INCLUDE_DIRS})
78
135.2.4 by Colin Watson
Use libclick to get package manifests, saving about 0.7 seconds from Click application startup.
79
pkg_check_modules(CLICK REQUIRED click-0.4>=0.4.18)
135.2.2 by Colin Watson
Use libclick to get the package directory, saving about 0.7 seconds from Click application startup.
80
include_directories(${CLICK_INCLUDE_DIRS})
81
92.2.8 by Ted Gould
Dropping libnih from the build
82
pkg_check_modules(LIBUPSTART REQUIRED libupstart)
33.6.9 by Ted Gould
Picking up URIs and handling
83
include_directories(${LIBUPSTART_INCLUDE_DIRS})
84
92.2.13 by Ted Gould
Grab the dbus build paths as well
85
pkg_check_modules(DBUS REQUIRED dbus-1)
86
include_directories(${DBUS_INCLUDE_DIRS})
87
76.3.19 by Ted Gould
Make sure we get dbusmock support in libdbustest
88
pkg_check_modules(DBUSTEST REQUIRED dbustest-1>=14.04.0)
76.3.4 by Ted Gould
Mock up starting an application
89
include_directories(${DBUSTEST_INCLUDE_DIRS})
90
87.2.1 by Ted Gould
Add the lttng-ust library
91
pkg_check_modules(LTTNG REQUIRED lttng-ust)
92
include_directories(${LTTNG_INCLUDE_DIRS})
93
150.2.9 by Ted Gould
Basic cgmanager queries
94
pkg_check_modules(CGMANAGER REQUIRED libcgmanager)
95
include_directories(${CGMANAGER_INCLUDE_DIRS})
96
257.1.28 by Ted Gould
Make required libraries required
97
pkg_check_modules(MIR REQUIRED mirclient)
184.1.3 by Ted Gould
Merging build systems
98
include_directories(${MIR_INCLUDE_DIRS})
99
257.1.28 by Ted Gould
Make required libraries required
100
pkg_check_modules(WHOOPSIE REQUIRED libwhoopsie)
208.9.1 by Ted Gould
Switching to libwhoopsie for recoverable problem support
101
include_directories(${WHOOPSIE_INCLUDE_DIRS})
102
257.1.28 by Ted Gould
Make required libraries required
103
pkg_check_modules(LIBERTINE REQUIRED libertine)
144.5.22 by Ted Gould
Grabbing liblibertine
104
include_directories(${LIBERTINE_INCLUDE_DIRS})
105
230.15.31 by Ted Gould
Make snappy backend include based on having new enough cURL
106
pkg_check_modules(CURL libcurl>=7.47)
230.15.2 by Ted Gould
Tying in the breakout branch versions so we only have the snap backend added here
107
include_directories(${CURL_INCLUDE_DIRS})
108
33.5.3 by Ted Gould
Base CMake stuff
109
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
110
112.3.28 by Ted Gould
Remove std=c11
111
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
33.5.5 by Ted Gould
Converting from Make to CMake
112
112.3.7 by Ted Gould
Switch to a helper
113
add_definitions( -DXMIR_HELPER="${pkglibexecdir}/xmir-helper" )
249.5.48 by Ted Gould
Use a build variable to get the path
114
add_definitions( -DSNAPPY_XMIR="${CMAKE_INSTALL_FULL_BINDIR}/snappy-xmir" )
112.3.7 by Ted Gould
Switch to a helper
115
33.5.5 by Ted Gould
Converting from Make to CMake
116
####################
117
# Helpers
118
####################
119
208.9.1 by Ted Gould
Switching to libwhoopsie for recoverable problem support
120
add_library(helpers STATIC helpers.c helpers-shared.c)
121
target_link_libraries(helpers ${GIO2_LIBRARIES} ${JSONGLIB_LIBRARIES} ${CLICK_LIBRARIES} ${WHOOPSIE_LIBRARIES})
33.5.5 by Ted Gould
Converting from Make to CMake
122
123
####################
124
# desktop-hook
125
####################
126
127
add_executable(desktop-hook desktop-hook.c)
128
set_target_properties(desktop-hook PROPERTIES OUTPUT_NAME "desktop-hook")
208.9.6 by Ted Gould
Adding whoopsie libs to the desktop hook
129
target_link_libraries(desktop-hook helpers ${CLICK_LIBRARIES} ${WHOOPSIE_LIBRARIES})
33.5.5 by Ted Gould
Converting from Make to CMake
130
install(TARGETS desktop-hook RUNTIME DESTINATION "${pkglibexecdir}")
131
132
####################
62.1.16 by Ted Gould
Changing click to work with a C file. And stubbing that C file.
133
# exec-line-exec
134
####################
135
87.2.2 by Ted Gould
Getting a simple tracepoint building
136
add_lttng_gen_tp(NAME exec-line-exec-trace)
87.2.3 by Ted Gould
Support out of tree builds
137
include_directories(${CMAKE_CURRENT_BINARY_DIR})
87.2.2 by Ted Gould
Getting a simple tracepoint building
138
add_executable(exec-line-exec exec-line-exec.c "${CMAKE_CURRENT_BINARY_DIR}/exec-line-exec-trace.c")
62.1.16 by Ted Gould
Changing click to work with a C file. And stubbing that C file.
139
set_target_properties(exec-line-exec PROPERTIES OUTPUT_NAME "exec-line-exec")
87.2.2 by Ted Gould
Getting a simple tracepoint building
140
target_link_libraries(exec-line-exec helpers ${LTTNG_LIBRARIES})
62.1.16 by Ted Gould
Changing click to work with a C file. And stubbing that C file.
141
install(TARGETS exec-line-exec RUNTIME DESTINATION "${pkglibexecdir}")
142
143
####################
33.5.5 by Ted Gould
Converting from Make to CMake
144
# zg-report-app
145
####################
146
147
add_executable(zg-report-app zg-report-app.c)
148
set_target_properties(zg-report-app PROPERTIES OUTPUT_NAME "zg-report-app")
154.5.4 by Ted Gould
Get the lib for the function
149
target_link_libraries(zg-report-app ubuntu-launcher ${ZEITGEIST_LIBRARIES} ${GOBJECT2_LIBRARIES} ${GLIB2_LIBRARIES})
33.5.5 by Ted Gould
Converting from Make to CMake
150
install(TARGETS zg-report-app RUNTIME DESTINATION "${pkglibexecdir}")
151
152
####################
92.3.11 by Ted Gould
Add an executable to be the application job
153
# application-job
154
####################
155
156
add_executable(application-job application-job.c)
157
set_target_properties(application-job PROPERTIES OUTPUT_NAME "application-job")
144.4.2 by Ted Gould
Build system and file moves
158
target_link_libraries(application-job ubuntu-launcher)
92.3.11 by Ted Gould
Add an executable to be the application job
159
install(TARGETS application-job RUNTIME DESTINATION "${pkglibexecdir}")
160
161
####################
61.2.15 by Ted Gould
Going C on this one
162
# application-failed
163
####################
164
165
add_executable(application-failed application-failed.c)
166
set_target_properties(application-failed PROPERTIES OUTPUT_NAME "application-failed")
167
target_link_libraries(application-failed ${GIO2_LIBRARIES})
168
install(TARGETS application-failed RUNTIME DESTINATION "${pkglibexecdir}")
169
170
####################
112.3.7 by Ted Gould
Switch to a helper
171
# xmir-helper
172
####################
173
174
add_executable(xmir-helper xmir-helper.c)
175
set_target_properties(xmir-helper PROPERTIES OUTPUT_NAME "xmir-helper")
176
install(TARGETS xmir-helper RUNTIME DESTINATION "${pkglibexecdir}")
177
178
####################
87.5.19 by Ted Gould
Add a helper for the type ending stuff
179
# untrusted-helper-type-end
180
####################
181
182
add_executable(untrusted-helper-type-end untrusted-helper-type-end.c)
183
set_target_properties(untrusted-helper-type-end PROPERTIES OUTPUT_NAME "untrusted-helper-type-end")
144.4.2 by Ted Gould
Build system and file moves
184
target_link_libraries(untrusted-helper-type-end ubuntu-launcher)
87.5.19 by Ted Gould
Add a helper for the type ending stuff
185
install(TARGETS untrusted-helper-type-end RUNTIME DESTINATION "${pkglibexecdir}")
186
187
####################
150.2.3 by Ted Gould
Adding a cgroup-reap-all utility
188
# cgroup-reap-all
189
####################
190
191
add_executable(cgroup-reap-all cgroup-reap-all.c)
192
set_target_properties(cgroup-reap-all PROPERTIES OUTPUT_NAME "cgroup-reap-all")
193
target_link_libraries(cgroup-reap-all helpers)
194
install(TARGETS cgroup-reap-all RUNTIME DESTINATION "${pkglibexecdir}")
195
196
####################
168.3.2 by Ted Gould
Starting out a little helper to make setuid and help us if we don't have permissions <cough>oxide</cough>
197
# oom-adjust-setuid-helper
198
####################
199
200
add_executable(oom-adjust-setuid-helper oom-adjust-setuid-helper.c)
201
set_target_properties(oom-adjust-setuid-helper PROPERTIES OUTPUT_NAME "oom-adjust-setuid-helper")
202
install(TARGETS oom-adjust-setuid-helper RUNTIME DESTINATION "${pkglibexecdir}")
203
204
####################
193.1.7 by Ted Gould
Stealing the demangler from pay-service
205
# socket-demangler
206
####################
207
208
add_executable(socket-demangler-helper socket-demangler.c)
209
set_target_properties(socket-demangler-helper PROPERTIES OUTPUT_NAME "socket-demangler")
210
target_link_libraries(socket-demangler-helper ${GIO2_LIBRARIES})
211
install(TARGETS socket-demangler-helper RUNTIME DESTINATION "${pkglibexecdir}")
212
213
####################
249.5.17 by Ted Gould
Starting utilities to put together an environment setup
214
# snappy-xmir
215
####################
216
249.5.53 by Ted Gould
Bigger libs warning. Like really people, read this.
217
####################
218
# NOTE: This only can link to libraries that are in
219
# the base UBUNTU CORE image. Which is basically libc
220
# and not much else. Don't add libs.
221
####################
222
249.5.17 by Ted Gould
Starting utilities to put together an environment setup
223
add_executable(snappy-xmir snappy-xmir.c)
224
set_target_properties(snappy-xmir PROPERTIES OUTPUT_NAME "snappy-xmir")
249.5.20 by Ted Gould
Get the binaries into a deb
225
install(TARGETS snappy-xmir RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}")
249.5.17 by Ted Gould
Starting utilities to put together an environment setup
226
227
####################
228
# snappy-xmir-envvars
229
####################
230
231
add_executable(snappy-xmir-envvars snappy-xmir-envvars.c)
232
set_target_properties(snappy-xmir-envvars PROPERTIES OUTPUT_NAME "snappy-xmir-envvars")
233
# No libs, otherwise we have to worry about how to handle finding them
249.5.20 by Ted Gould
Get the binaries into a deb
234
install(TARGETS snappy-xmir-envvars RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}")
249.5.17 by Ted Gould
Starting utilities to put together an environment setup
235
236
237
####################
144.4.2 by Ted Gould
Build system and file moves
238
# ubuntu-app-launch-desktop.click-hook
33.5.5 by Ted Gould
Converting from Make to CMake
239
####################
240
144.4.2 by Ted Gould
Build system and file moves
241
configure_file("ubuntu-app-launch-desktop.click-hook.in" "${CMAKE_CURRENT_SOURCE_DIR}/debian/ubuntu-app-launch-desktop.click-hook" @ONLY)
33.5.5 by Ted Gould
Converting from Make to CMake
242
144.4.2 by Ted Gould
Build system and file moves
243
add_subdirectory(libubuntu-app-launch)
87.5.5 by Ted Gould
Create a directory for upstart jobs
244
add_subdirectory(upstart-jobs)
87.5.10 by Ted Gould
Giving the tools their own directory
245
add_subdirectory(tools)
184.1.3 by Ted Gould
Merging build systems
246
add_subdirectory(ubuntu-app-test)
62.1.47 by Ted Gould
Setting up a test directory
247
248
# testing & coverage
249
if (${enable_tests})
250
  enable_testing ()
251
  add_subdirectory(tests)
252
endif ()
253
269.1.1 by Pete Woods
Compatibility with unversioned cmake-extras modules
254
find_package(CoverageReport)
230.8.1 by Rodney Dawes
Use cmake-extras for coverage reporting.
255
set(filter-list)
256
list(APPEND filter-list "/usr/include")
257
list(APPEND filter-list "${CMAKE_SOURCE_DIR}/tests/*")
258
if (NOT ${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
259
  list(APPEND filter-list "${CMAKE_BINARY_DIR}/*")
260
endif()
261
ENABLE_COVERAGE_REPORT(
257.1.13 by Ted Gould
Get the static libs into the coverage game
262
  TARGETS
263
  	ubuntu-launcher
264
	launcher-static
265
  TESTS
266
  	application-icon-finder-test
267
	application-info-desktop-test
257.1.29 by Ted Gould
Fix listing of targets
268
	cgroup-reap-test
269
	exec-util-test
257.1.13 by Ted Gould
Get the static libs into the coverage game
270
	failure-test
271
	helper-test
272
	helper-handshake-test
257.1.21 by Ted Gould
Alphabetize list
273
	jobs-base-test
257.1.13 by Ted Gould
Get the static libs into the coverage game
274
	libual-test
275
	libual-cpp-test
276
	list-apps
257.1.24 by Ted Gould
Remove -lgcov hack and add snapd-info-test to the list of tests
277
	snapd-info-test
257.1.13 by Ted Gould
Get the static libs into the coverage game
278
	zg-test
279
  FILTER
280
  	${filter-list}
230.8.1 by Rodney Dawes
Use cmake-extras for coverage reporting.
281
)