~khurshid-alam/hud/upload-to-focal

324.2.1 by Pete Woods
Beginnings of window stack bridge
1
project(hud C CXX)
227.118.1 by Pete Woods
Enough is working to compile hud-service
2
cmake_minimum_required(VERSION 2.8.9)
3
4
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}")
5
6
set(PACKAGE ${CMAKE_PROJECT_NAME})
7
set(GETTEXT_PACKAGE ${CMAKE_PROJECT_NAME})
8
227.131.2 by Pete Woods
Make documentation only build when asked for (on by default in CI builds)
9
option(ENABLE_DOCUMENTATION "Enable documentation." OFF)
227.121.1 by Pete Woods
Convert CMake variables to upper case and make gsettings_localinstall default to the same as local_install
10
option(ENABLE_TESTS "Enable tests." ON)
11
option(ENABLE_SCALABILITY_TESTS "Additional scalability tests that are potentially very slow to run." OFF)
12
option(LOCAL_INSTALL "Support local installation." OFF)
324.2.3 by Pete Woods
Basic connection from HUD -> window stack -> BAMF
13
option(ENABLE_BAMF "Enable building for BAMF." ON)
227.118.1 by Pete Woods
Enough is working to compile hud-service
14
227.122.1 by Pete Woods
Re-enable test coverage reporting
15
# Trick the H10enable_coverage script into enabling coverage by including the text below:
227.122.2 by Pete Woods
Need to add the word coverage, too
16
# CMAKE_BUILD_TYPE coverage
227.122.1 by Pete Woods
Re-enable test coverage reporting
17
227.118.1 by Pete Woods
Enough is working to compile hud-service
18
find_package(PkgConfig REQUIRED)
227.118.5 by Pete Woods
Fix compile warnings
19
include(GNUInstallDirs)
227.118.1 by Pete Woods
Enough is working to compile hud-service
20
include(CheckIncludeFile)
227.118.5 by Pete Woods
Fix compile warnings
21
include(CheckFunctionExists)
227.118.45 by Pete Woods
Make CMake files more consistent with the built in ones
22
include(UseGlibGeneration)
23
include(UseGdbusCodegen)
24
include(UseConstantBuilder)
410.1.1 by Pete Woods
Compatibility with unversioned cmake-extras modules
25
find_package(GSettings)
227.118.45 by Pete Woods
Make CMake files more consistent with the built in ones
26
include(UseVala)
227.118.15 by Pete Woods
Packaging fixes
27
28
# Workaround for libexecdir on debian
29
if (EXISTS "/etc/debian_version") 
30
  set(CMAKE_INSTALL_LIBEXECDIR ${CMAKE_INSTALL_LIBDIR})
31
  set(CMAKE_INSTALL_FULL_LIBEXECDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBEXECDIR}")
32
endif()
227.118.1 by Pete Woods
Enough is working to compile hud-service
33
34
set(HUD_QUERY_XML ${CMAKE_CURRENT_SOURCE_DIR}/data/com.canonical.hud.query.xml)
35
set(HUD_SERVICE_XML ${CMAKE_CURRENT_SOURCE_DIR}/data/com.canonical.hud.xml)
36
set(HUD_APP_XML ${CMAKE_CURRENT_SOURCE_DIR}/data/com.canonical.hud.Application.xml)
37
324.2.1 by Pete Woods
Beginnings of window stack bridge
38
set(WINDOW_STACK_XML "${CMAKE_CURRENT_SOURCE_DIR}/data/com.canonical.Unity.WindowStack.xml")
340.9.4 by Pete Woods
Basic listening for window open / closed and creates collectors for GMenu and DBusMenu
39
set(APPMENU_REGISTRAR_XML "${CMAKE_CURRENT_SOURCE_DIR}/data/com.canonical.AppMenu.Registrar.xml")
324.2.1 by Pete Woods
Beginnings of window stack bridge
40
324.2.3 by Pete Woods
Basic connection from HUD -> window stack -> BAMF
41
set(BAMF_XML "${CMAKE_CURRENT_SOURCE_DIR}/data/org.ayatana.bamf.xml")
42
set(BAMF_VIEW_XML "${CMAKE_CURRENT_SOURCE_DIR}/data/org.ayatana.bamf.view.xml")
43
227.118.1 by Pete Woods
Enough is working to compile hud-service
44
set(HUD_TOP_DIR ${CMAKE_CURRENT_SOURCE_DIR})
227.118.7 by Pete Woods
API/ABI versions and package config files
45
set(HUD_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
227.118.1 by Pete Woods
Enough is working to compile hud-service
46
227.118.5 by Pete Woods
Fix compile warnings
47
add_definitions( -DDATADIR="${CMAKE_INSTALL_FULL_DATADIR}" )
48
add_definitions( -DGNOMELOCALEDIR="${CMAKE_INSTALL_FULL_DATADIR}/locale" )
227.118.1 by Pete Woods
Enough is working to compile hud-service
49
add_definitions( -DGETTEXT_PACKAGE="${GETTEXT_PACKAGE}" )
227.118.5 by Pete Woods
Fix compile warnings
50
add_definitions( -DLIBEXECDIR="${CMAKE_INSTALL_FULL_LIBEXECDIR}" )
227.118.1 by Pete Woods
Enough is working to compile hud-service
51
52
pkg_check_modules(GLIB2 REQUIRED glib-2.0)
53
include_directories(${GLIB2_INCLUDE_DIRS})
54
55
pkg_check_modules(GOBJECT2 REQUIRED gobject-2.0)
56
include_directories(${GOBJECT2_INCLUDE_DIRS})
57
58
pkg_check_modules(GIO2 REQUIRED gio-2.0)
59
include_directories(${GIO2_INCLUDE_DIRS})
60
61
pkg_check_modules(GIO_UNIX2 REQUIRED gio-unix-2.0)
62
include_directories(${GIO_UNIX2_INCLUDE_DIRS})
63
64
pkg_check_modules(DEE REQUIRED dee-1.0)
65
include_directories(${DEE_INCLUDE_DIRS})
66
67
pkg_check_modules(DBUSMENU_GLIB REQUIRED dbusmenu-glib-0.4)
68
include_directories(${DBUSMENU_GLIB_INCLUDE_DIRS})
69
227.118.12 by Pete Woods
Make the tools compile
70
pkg_search_module(GTK3 REQUIRED gtk+-3.0)
71
include_directories(${GTK3_INCLUDE_DIRS})
72
340.9.36 by Pete Woods
Basic searching of dbusmenu windows
73
pkg_check_modules(COLUMBUS REQUIRED libcolumbus)
74
include_directories(${COLUMBUS_INCLUDE_DIRS})
340.9.5 by Pete Woods
Starting to make the first test
75
324.2.1 by Pete Woods
Beginnings of window stack bridge
76
find_package(Qt5Core REQUIRED)
77
include_directories(${Qt5Core_INCLUDE_DIRS})
78
340.9.4 by Pete Woods
Basic listening for window open / closed and creates collectors for GMenu and DBusMenu
79
find_package(Qt5Widgets REQUIRED)
80
include_directories(${Qt5Widgets_INCLUDE_DIRS})
81
324.2.1 by Pete Woods
Beginnings of window stack bridge
82
find_package(Qt5DBus REQUIRED)
83
include_directories(${Qt5DBus_INCLUDE_DIRS})
84
358.1.2 by Pete Woods
Implement SQLite backed usage tracker
85
find_package(Qt5Sql REQUIRED)
86
include_directories(${Qt5Sql_INCLUDE_DIRS})
87
340.9.41 by Pete Woods
Include the Unity8 facing Qt API in libhud-client
88
pkg_check_modules(DEE_QT REQUIRED libdee-qt5)
89
include_directories(${DEE_QT_INCLUDE_DIRS})
90
340.9.188 by Pete Woods
Read search index settings from GSettings
91
pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt REQUIRED)
92
include_directories(${GSETTINGS_QT_INCLUDE_DIRS})
93
340.9.4 by Pete Woods
Basic listening for window open / closed and creates collectors for GMenu and DBusMenu
94
pkg_check_modules(DBUSMENU REQUIRED dbusmenu-qt5)
95
include_directories(${DBUSMENU_INCLUDE_DIRS})
96
340.9.5 by Pete Woods
Starting to make the first test
97
find_package(Qt5Test REQUIRED)
98
include_directories(${Qt5Test_INCLUDE_DIRS})
99
100
pkg_check_modules(QTDBUSTEST REQUIRED libqtdbustest-1 REQUIRED)
101
include_directories(${QTDBUSTEST_INCLUDE_DIRS})
102
103
pkg_check_modules(QTDBUSMOCK REQUIRED libqtdbusmock-1 REQUIRED)
104
include_directories(${QTDBUSMOCK_INCLUDE_DIRS})
105
227.118.42 by Pete Woods
Make Vala based artifacts build and install
106
find_package(Vala 0.12)
107
227.118.21 by Pete Woods
GObject introspection
108
find_package(GObjectIntrospection 0.9.12)
109
227.118.5 by Pete Woods
Fix compile warnings
110
check_include_file("signal.h" HAVE_SIGNAL_H)
227.118.21 by Pete Woods
GObject introspection
111
if(${HAVE_SIGNAL_H})
227.118.5 by Pete Woods
Fix compile warnings
112
  set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} "signal.h")
113
  check_function_exists(kill HAVE_KILL)
114
endif()
227.118.1 by Pete Woods
Enough is working to compile hud-service
115
227.121.1 by Pete Woods
Convert CMake variables to upper case and make gsettings_localinstall default to the same as local_install
116
if(${LOCAL_INSTALL})
227.118.10 by Pete Woods
Add data directory
117
  set(DBUSSERVICEDIR "${CMAKE_INSTALL_DATADIR}/dbus-1/services/")
118
else()
119
  EXEC_PROGRAM(${PKG_CONFIG_EXECUTABLE} ARGS dbus-1 --variable session_bus_services_dir OUTPUT_VARIABLE DBUSSERVICEDIR )
120
endif()
227.118.21 by Pete Woods
GObject introspection
121
message("Installing DBus services to ${DBUSSERVICEDIR}")
227.118.10 by Pete Woods
Add data directory
122
227.121.1 by Pete Woods
Convert CMake variables to upper case and make gsettings_localinstall default to the same as local_install
123
if(${LOCAL_INSTALL})
227.118.10 by Pete Woods
Add data directory
124
  set(DBUSIFACEDIR "${CMAKE_INSTALL_DATADIR}/dbus-1/interfaces/")
125
else()
126
  EXEC_PROGRAM(${PKG_CONFIG_EXECUTABLE} ARGS dbus-1 --variable interfaces_dir OUTPUT_VARIABLE DBUSIFACEDIR )
127
endif()
227.118.21 by Pete Woods
GObject introspection
128
message("Installing DBus interfaces to ${DBUSIFACEDIR}")
227.118.10 by Pete Woods
Add data directory
129
227.118.1 by Pete Woods
Enough is working to compile hud-service
130
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
131
include_directories(${CMAKE_CURRENT_BINARY_DIR})
132
324.2.1 by Pete Woods
Beginnings of window stack bridge
133
set(CMAKE_AUTOMOC ON)
134
set(CMAKE_INCLUDE_CURRENT_DIR ON)
135
340.9.5 by Pete Woods
Starting to make the first test
136
add_definitions(
340.9.41 by Pete Woods
Include the Unity8 facing Qt API in libhud-client
137
	-DQT_NO_SIGNALS_SLOTS_KEYWORDS=1
138
)
139
227.131.1 by Pete Woods
Set C standard to C11 and add option to disable documentation building
140
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -fPIC")
340.9.41 by Pete Woods
Include the Unity8 facing Qt API in libhud-client
141
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-permissive")
227.118.1 by Pete Woods
Enough is working to compile hud-service
142
340.9.134 by Pete Woods
Fix symbol visibility
143
include(GenerateExportHeader)
144
227.118.10 by Pete Woods
Add data directory
145
add_subdirectory(data)
340.9.2 by Pete Woods
Skeleton of most services exists now
146
add_subdirectory(common)
227.118.1 by Pete Woods
Enough is working to compile hud-service
147
add_subdirectory(libhud-client)
148
add_subdirectory(libhud)
227.118.31 by Pete Woods
libhud-gtk
149
add_subdirectory(libhud-gtk)
340.10.1 by Marcus Tomlinson
Introduced QtGMenu library to allow exporting and importing of QMenus / GMenu via dbus.
150
add_subdirectory(libqtgmenu)
340.9.2 by Pete Woods
Skeleton of most services exists now
151
add_subdirectory(service)
340.9.133 by Pete Woods
Build the tools again
152
add_subdirectory(tools)
324.2.3 by Pete Woods
Basic connection from HUD -> window stack -> BAMF
153
add_subdirectory(window-stack-bridge)
227.118.1 by Pete Woods
Enough is working to compile hud-service
154
227.121.1 by Pete Woods
Convert CMake variables to upper case and make gsettings_localinstall default to the same as local_install
155
if(${ENABLE_TESTS})
340.9.5 by Pete Woods
Starting to make the first test
156
	enable_testing()
157
	ADD_CUSTOM_TARGET(
158
		check
159
		${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure
160
	)
376.1.3 by Pete Woods
Use tempMatch
161
	add_subdirectory(tests)
410.1.3 by Pete Woods
Use cmake-extras macro for coverage reporting
162
163
	find_package(CoverageReport)
164
	enable_coverage_report(
165
		TARGETS
166
			hud-generated
167
			hud
168
			hud-cli
169
			hud-cli-appstack
170
			hud-cli-param
171
			hud-cli-toolbar
172
			hud-client-generated
173
			hud-client
174
			hud-common
175
			hud-gtk
176
			hud-service
177
			hud-service-exec
178
			qtgmenu
179
			window-stack-bridge
180
			window-stack-bridge-bin
181
			dbusmenu-json-loader
182
			hud-test-interface
183
			qtgmenu-test-app
184
			test-integration-tests
185
			test-libhud-application
186
			test-libhud-client-unit-tests
187
			test-libhud-unit-tests
188
			test-menu-input-model-deep
189
			test-menu-input-model-shortcuts
190
			test-menu-input-model-simple
191
			test-menu-input-model-toolbar-all
192
			test-menu-input-model-toolbar-dynamic
193
			test-menu-input-model-toolbar-undo
194
			test-menu-input-model-toolbar-unknown
195
			test-qtgmenu-unit-tests
196
			test-service-unit-tests
197
			test-utils
198
			test-window-stack-bridge-unit-tests
199
		FILTER
200
			${CMAKE_SOURCE_DIR}/tests/*
201
			${CMAKE_BINARY_DIR}/*
202
		TESTS
203
			dbusmenu-json-loader
204
			hud-test-interface
205
			qtgmenu-test-app
206
			test-integration-tests
207
			test-libhud-application
208
			test-libhud-client-unit-tests
209
			test-libhud-unit-tests
210
			test-menu-input-model-deep
211
			test-menu-input-model-shortcuts
212
			test-menu-input-model-simple
213
			test-menu-input-model-toolbar-all
214
			test-menu-input-model-toolbar-dynamic
215
			test-menu-input-model-toolbar-undo
216
			test-menu-input-model-toolbar-unknown
217
			test-qtgmenu-unit-tests
218
			test-service-unit-tests
219
			test-utils
220
			test-window-stack-bridge-unit-tests
221
	)
227.118.1 by Pete Woods
Enough is working to compile hud-service
222
endif()
227.118.30 by Pete Woods
Run gtkdoc tests and add missing documentation
223
340.9.5 by Pete Woods
Starting to make the first test
224
227.118.44 by Pete Woods
Build and install the python tool
225
add_subdirectory(tools-vala)
227.131.1 by Pete Woods
Set C standard to C11 and add option to disable documentation building
226
if(${ENABLE_DOCUMENTATION})
227
  add_subdirectory(docs)
228
endif()