317.4.1
by Jussi Pakkanen
Started on CMake build skeleton. |
1 |
project(ubuntu-system-settings C CXX) |
2 |
cmake_minimum_required(VERSION 2.8.10) |
|
3 |
||
480.2.5
by Iain Lane
Oops, don't break the CMakeLists |
4 |
if(${PROJECT_BINARY_DIR} STREQUAL ${PROJECT_SOURCE_DIR}) |
5 |
message(FATAL_ERROR "In-tree build attempt detected, aborting. Set your build dir outside your source dir, delete CMakeCache.txt from source root and try again.") |
|
6 |
endif() |
|
317.4.1
by Jussi Pakkanen
Started on CMake build skeleton. |
7 |
|
8 |
string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_lower) # Build types should always be lowercase but sometimes they are not. |
|
9 |
||
317.4.23
by Jussi Pakkanen
Generate pkg-config file and install it. |
10 |
set(PROJECT_VERSION 0.1) |
317.4.35
by Jussi Pakkanen
Added coverage support. |
11 |
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) |
12 |
include(EnableCoverageReport) |
|
317.4.1
by Jussi Pakkanen
Started on CMake build skeleton. |
13 |
include(FindPkgConfig) |
14 |
include(GNUInstallDirs) |
|
317.4.2
by Jussi Pakkanen
Some more progression towards CMake. |
15 |
set(LIBDIR ${CMAKE_INSTALL_LIBDIR}) |
317.4.1
by Jussi Pakkanen
Started on CMake build skeleton. |
16 |
enable_testing() |
17 |
||
317.4.35
by Jussi Pakkanen
Added coverage support. |
18 |
if(cmake_build_type_lower MATCHES coverage) |
19 |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage" ) |
|
20 |
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage" ) |
|
21 |
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} --coverage" ) |
|
22 |
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage" ) |
|
23 |
||
24 |
# We add -g when building with coverage so valgrind reports line numbers.
|
|
25 |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g" ) |
|
26 |
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g" ) |
|
27 |
endif() |
|
28 |
||
29 |
||
317.4.18
by Jussi Pakkanen
Translations can be installed. |
30 |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -fno-permissive -pedantic -Wall -Wextra") |
317.4.1
by Jussi Pakkanen
Started on CMake build skeleton. |
31 |
find_package(Qt5Widgets REQUIRED) |
32 |
# Workaround for https://bugreports.qt-project.org/browse/QTBUG-29987
|
|
33 |
set(QT_IMPORTS_DIR "${CMAKE_INSTALL_LIBDIR}/qt5/qml") |
|
317.4.4
by Jussi Pakkanen
Can build full executable. |
34 |
set(CMAKE_AUTOMOC ON) |
317.4.1
by Jussi Pakkanen
Started on CMake build skeleton. |
35 |
|
1101.2.1
by Iain Lane
[security-privacy] Link with gobject, uses symbols from this library |
36 |
pkg_search_module(GOBJECT REQUIRED gobject-2.0) |
317.4.7
by Jussi Pakkanen
Can build battery plugin. |
37 |
pkg_search_module(GLIB REQUIRED glib-2.0) |
317.4.50
by Jussi Pakkanen
Merged trunk. |
38 |
pkg_check_modules(GIO REQUIRED gio-2.0 gio-unix-2.0) |
317.4.7
by Jussi Pakkanen
Can build battery plugin. |
39 |
pkg_search_module(UPOWER_GLIB REQUIRED upower-glib) |
40 |
pkg_search_module(LIBNM_GLIB REQUIRED libnm-glib) |
|
317.4.8
by Jussi Pakkanen
Compile a few plugins more. |
41 |
pkg_search_module(ACCOUNTSSERVICE REQUIRED accountsservice) |
1595.3.1
by Michael Terry
Port to libgeonames |
42 |
pkg_search_module(GEONAMES REQUIRED geonames) |
519.2.1
by William Hua
Use ICU for language names and codes. |
43 |
pkg_search_module(ICU REQUIRED icu-i18n) |
655.1.1
by Colin Watson
Only build the about plugin on architectures that have libandroid-properties-dev. |
44 |
pkg_search_module(ANDR_PROP libandroid-properties) |
806.1.12
by Mathieu Trudel-Lapierre
add Build-Depends on libqtdbusmock1-dev and libqtdbustest1-dev for Bluetooth testing |
45 |
pkg_check_modules(QTDBUSMOCK REQUIRED libqtdbusmock-1 REQUIRED) |
46 |
pkg_check_modules(QTDBUSTEST REQUIRED libqtdbustest-1 REQUIRED) |
|
743.2.11
by Michael Terry
Use PAM instead of text keyfile |
47 |
pkg_search_module(POLKIT_AGENT polkit-agent-1) |
1077.3.1
by Sebastien Bacher
[storage] use libclick rather than calling the command line |
48 |
pkg_search_module(CLICK REQUIRED click-0.4) |
317.4.7
by Jussi Pakkanen
Can build battery plugin. |
49 |
|
317.4.17
by Jussi Pakkanen
Some cleanups and po. |
50 |
find_program(XGETTEXT_BIN xgettext) |
317.4.18
by Jussi Pakkanen
Translations can be installed. |
51 |
find_program(MSGFMT_BIN msgfmt) |
1030.3.1
by Ken VanDine
Translate desktop file (LP: #1318008) |
52 |
find_program(INTLTOOL_MERGE intltool-merge) |
53 |
find_program(INTLTOOL_EXTRACT intltool-extract) |
|
317.4.17
by Jussi Pakkanen
Some cleanups and po. |
54 |
|
317.4.2
by Jussi Pakkanen
Some more progression towards CMake. |
55 |
set(PLUGIN_MANIFEST_DIR_BASE share/ubuntu/settings/system) |
56 |
set(PLUGIN_MODULE_DIR_BASE ubuntu-system-settings) |
|
57 |
set(PLUGIN_PRIVATE_MODULE_DIR_BASE "${PLUGIN_MODULE_DIR_BASE}/private") |
|
58 |
set(PLUGIN_QML_DIR_BASE share/ubuntu/settings/system/qml-plugins) |
|
59 |
||
60 |
set(PLUGIN_MANIFEST_DIR "${CMAKE_INSTALL_PREFIX}/${PLUGIN_MANIFEST_DIR_BASE}") |
|
317.4.49
by Jussi Pakkanen
Add prefix to module dir definitions. |
61 |
set(PLUGIN_MODULE_DIR "${CMAKE_INSTALL_PREFIX}/${LIBDIR}/${PLUGIN_MODULE_DIR_BASE}") |
317.4.2
by Jussi Pakkanen
Some more progression towards CMake. |
62 |
set(PLUGIN_QML_DIR "${CMAKE_INSTALL_PREFIX}/${PLUGIN_QML_DIR_BASE}") |
317.4.49
by Jussi Pakkanen
Add prefix to module dir definitions. |
63 |
set(PLUGIN_PRIVATE_MODULE_DIR "${CMAKE_INSTALL_PREFIX}/${LIBDIR}/${PLUGIN_PRIVATE_MODULE_DIR_BASE}") |
555.1.3
by Sebastien Bacher
use a new variable to install the screenshot image |
64 |
set(SETTINGS_SHARE_DIR "${CMAKE_INSTALL_PREFIX}/${PLUGIN_MANIFEST_DIR_BASE}") |
779.1.44
by John R. Lenton
use cmake to install the helper, not debian/rules. |
65 |
set(PUSH_HELPER_DIR "lib/ubuntu-push-client/legacy-helpers") |
317.4.2
by Jussi Pakkanen
Some more progression towards CMake. |
66 |
|
544.1.5
by Iain Lane
Set RPATH to have the runtime linker find the private libraries |
67 |
SET(CMAKE_INSTALL_RPATH "${PLUGIN_MODULE_DIR}") |
68 |
||
1030.3.1
by Ken VanDine
Translate desktop file (LP: #1318008) |
69 |
set(DESKTOP_FILE ubuntu-system-settings.desktop) |
70 |
set(GETTEXT_PACKAGE ubuntu-system-settings) |
|
71 |
||
317.4.18
by Jussi Pakkanen
Translations can be installed. |
72 |
add_subdirectory(po) |
317.4.20
by Jussi Pakkanen
Install XML schema. |
73 |
add_subdirectory(schema) |
317.4.4
by Jussi Pakkanen
Can build full executable. |
74 |
add_subdirectory(lib) |
317.4.7
by Jussi Pakkanen
Can build battery plugin. |
75 |
include_directories(lib) |
544.1.4
by Iain Lane
Add src/ to include directories so accountsservice.h can be found |
76 |
include_directories(src) |
317.4.5
by Jussi Pakkanen
Build about plugin. |
77 |
add_subdirectory(plugins) |
317.4.1
by Jussi Pakkanen
Started on CMake build skeleton. |
78 |
add_subdirectory(src) |
317.4.11
by Jussi Pakkanen
Compile tests. |
79 |
add_subdirectory(tests) |
80 |
||
1030.3.1
by Ken VanDine
Translate desktop file (LP: #1318008) |
81 |
configure_file(${DESKTOP_FILE}.in.in ${DESKTOP_FILE}.in @ONLY) |
82 |
add_custom_target(${DESKTOP_FILE} ALL |
|
83 |
COMMENT "Merging translations into ${DESKTOP_FILE}" |
|
84 |
COMMAND ${INTLTOOL_MERGE} -d -u ${CMAKE_SOURCE_DIR}/po |
|
85 |
${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE}.in ${DESKTOP_FILE}) |
|
86 |
||
87 |
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${DESKTOP_FILE} |
|
88 |
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) |
|
89 |
||
560.2.1
by Ted Gould
Adding a URL specification file for the settings protocol |
90 |
install(FILES ubuntu-system-settings.url-dispatcher DESTINATION share/url-dispatcher/urls) |
555.1.3
by Sebastien Bacher
use a new variable to install the screenshot image |
91 |
install(FILES screenshot.png DESTINATION ${SETTINGS_SHARE_DIR}) |
1051.1.1
by Ken VanDine
Include an icon instead of using the themed icon (LP: #1365408) |
92 |
install(FILES system-settings.png DESTINATION ${SETTINGS_SHARE_DIR}) |
1030.7.1
by John R. Lenton
updated push helper to cope with system updates closer to spec |
93 |
install(PROGRAMS push-helper/software_updates_helper.py DESTINATION ${PUSH_HELPER_DIR} RENAME ubuntu-system-settings) |
317.4.35
by Jussi Pakkanen
Added coverage support. |
94 |
|
95 |
if(cmake_build_type_lower MATCHES coverage) |
|
707.1.1
by Brendan Donegan
Change the coverage filter in CMakeLists.txt from test to tests, to match the directory name |
96 |
ENABLE_COVERAGE_REPORT(TARGETS system-settings FILTER /usr/include ${CMAKE_SOURCE_DIR}/tests/* ${CMAKE_BINARY_DIR}/*) |
317.4.35
by Jussi Pakkanen
Added coverage support. |
97 |
endif() |