Merge lp:~thomas-voss/location-service/clean-up-cmake-setup into lp:location-service
- clean-up-cmake-setup
- Merge into next
Proposed by
Thomas Voß
Status: | Merged |
---|---|
Approved by: | Thomas Voß |
Approved revision: | 311 |
Merged at revision: | 313 |
Proposed branch: | lp:~thomas-voss/location-service/clean-up-cmake-setup |
Merge into: | lp:location-service |
Diff against target: |
577 lines (+22/-404) 11 files modified
CMakeLists.txt (+13/-35) cmake/EnableCoverageReport.cmake (+0/-153) cmake/FindLcov.cmake (+0/-29) cmake/Findgcovr.cmake (+0/-31) cmake/ParseArguments.cmake (+0/-52) cmake/PrePush.cmake (+0/-81) data/ubuntu-location-service-connectivity.pc.in (+2/-2) data/ubuntu-location-service.pc.in (+1/-1) src/location/CMakeLists.txt (+5/-5) src/location/config.h.in (+1/-4) tests/CMakeLists.txt (+0/-11) |
To merge this branch: | bzr merge lp:~thomas-voss/location-service/clean-up-cmake-setup |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Simon Fels (community) | Approve | ||
Thomas Voß | Pending | ||
Review via email: mp+324060@code.launchpad.net |
Commit message
Clean up and trim down cmake setup.
Description of the change
Clean up and trim down cmake setup.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2017-05-10 11:09:37 +0000 | |||
3 | +++ CMakeLists.txt 2017-05-15 13:20:09 +0000 | |||
4 | @@ -1,6 +1,6 @@ | |||
5 | 1 | cmake_minimum_required(VERSION 2.8) | 1 | cmake_minimum_required(VERSION 2.8) |
6 | 2 | 2 | ||
8 | 3 | project(ubuntu-location-service) | 3 | project(locationd) |
9 | 4 | 4 | ||
10 | 5 | if (DEFINED SNAPPY_UBUNTU_CORE) | 5 | if (DEFINED SNAPPY_UBUNTU_CORE) |
11 | 6 | add_definitions(-DSNAPPY_UBUNTU_CORE) | 6 | add_definitions(-DSNAPPY_UBUNTU_CORE) |
12 | @@ -9,7 +9,7 @@ | |||
13 | 9 | # We haven't received version information via the packaging setup. | 9 | # We haven't received version information via the packaging setup. |
14 | 10 | # For that, we try to determine sensible values on our own, ensuring | 10 | # For that, we try to determine sensible values on our own, ensuring |
15 | 11 | # plain old invocations to cmake still work as expected. | 11 | # plain old invocations to cmake still work as expected. |
17 | 12 | if (NOT DEFINED UBUNTU_LOCATION_SERVICE_VERSION_MAJOR) | 12 | if (NOT DEFINED LOCATIOND_VERSION_MAJOR) |
18 | 13 | find_program(LSB_RELEASE lsb_release) | 13 | find_program(LSB_RELEASE lsb_release) |
19 | 14 | execute_process( | 14 | execute_process( |
20 | 15 | COMMAND ${LSB_RELEASE} -c -s | 15 | COMMAND ${LSB_RELEASE} -c -s |
21 | @@ -23,19 +23,17 @@ | |||
22 | 23 | # - errors | 23 | # - errors |
23 | 24 | # we define the version to be 2.0.0 | 24 | # we define the version to be 2.0.0 |
24 | 25 | if (${DISTRO_CODENAME} STREQUAL "vivid") | 25 | if (${DISTRO_CODENAME} STREQUAL "vivid") |
28 | 26 | set(UBUNTU_LOCATION_SERVICE_VERSION_MAJOR 3) | 26 | set(LOCATIOND_VERSION_MAJOR 3) |
29 | 27 | set(UBUNTU_LOCATION_SERVICE_VERSION_MINOR 0) | 27 | set(LOCATIOND_VERSION_MINOR 0) |
30 | 28 | set(UBUNTU_LOCATION_SERVICE_VERSION_PATCH 0) | 28 | set(LOCATIOND_VERSION_PATCH 0) |
31 | 29 | else () | 29 | else () |
35 | 30 | set(UBUNTU_LOCATION_SERVICE_VERSION_MAJOR 4) | 30 | set(LOCATIOND_VERSION_MAJOR 4) |
36 | 31 | set(UBUNTU_LOCATION_SERVICE_VERSION_MINOR 0) | 31 | set(LOCATIOND_VERSION_MINOR 0) |
37 | 32 | set(UBUNTU_LOCATION_SERVICE_VERSION_PATCH 0) | 32 | set(LOCATIOND_VERSION_PATCH 0) |
38 | 33 | endif() | 33 | endif() |
39 | 34 | endif() | 34 | endif() |
40 | 35 | 35 | ||
44 | 36 | message(STATUS "${CMAKE_PROJECT_NAME} ${UBUNTU_LOCATION_SERVICE_VERSION_MAJOR}.${UBUNTU_LOCATION_SERVICE_VERSION_MINOR}.${UBUNTU_LOCATION_SERVICE_VERSION_PATCH}") | 36 | message(STATUS "${CMAKE_PROJECT_NAME} ${LOCATIOND_VERSION_MAJOR}.${LOCATIOND_VERSION_MINOR}.${LOCATIOND_VERSION_PATCH}") |
42 | 37 | |||
43 | 38 | set(UBUNTU_LOCATION_SERVICE_TRUST_STORE_SERVICE_NAME "UbuntuLocationService") | ||
45 | 39 | 37 | ||
46 | 40 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic -Wextra -fPIC") | 38 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic -Wextra -fPIC") |
47 | 41 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -pedantic -Wextra -fPIC -pthread") | 39 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -fno-strict-aliasing -fvisibility=hidden -fvisibility-inlines-hidden -pedantic -Wextra -fPIC -pthread") |
48 | @@ -43,10 +41,6 @@ | |||
49 | 43 | 41 | ||
50 | 44 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) | 42 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) |
51 | 45 | 43 | ||
52 | 46 | include(cmake/EnableCoverageReport.cmake) | ||
53 | 47 | include(cmake/FindGFlags.cmake) | ||
54 | 48 | include(cmake/FindGLog.cmake) | ||
55 | 49 | include(cmake/PrePush.cmake) | ||
56 | 50 | include(CTest) | 44 | include(CTest) |
57 | 51 | 45 | ||
58 | 52 | include(GNUInstallDirs) | 46 | include(GNUInstallDirs) |
59 | @@ -67,20 +61,6 @@ | |||
60 | 67 | pkg_check_modules(UBUNTU_PLATFORM_HARDWARE_API ubuntu-platform-hardware-api) | 61 | pkg_check_modules(UBUNTU_PLATFORM_HARDWARE_API ubuntu-platform-hardware-api) |
61 | 68 | pkg_check_modules(GIO gio-2.0) | 62 | pkg_check_modules(GIO gio-2.0) |
62 | 69 | pkg_check_modules(GIO_UNIX gio-unix-2.0) | 63 | pkg_check_modules(GIO_UNIX gio-unix-2.0) |
63 | 70 | ##################################################################### | ||
64 | 71 | # Enable code coverage calculation with gcov/gcovr/lcov | ||
65 | 72 | # Usage: | ||
66 | 73 | # * Switch build type to coverage (use ccmake or cmake-gui) | ||
67 | 74 | # * Invoke make, make test, make coverage | ||
68 | 75 | # * Find html report in subdir coveragereport | ||
69 | 76 | # * Find xml report feasible for jenkins in coverage.xml | ||
70 | 77 | ##################################################################### | ||
71 | 78 | IF(CMAKE_BUILD_TYPE MATCHES [cC][oO][vV][eE][rR][aA][gG][eE]) | ||
72 | 79 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftest-coverage -fprofile-arcs" ) | ||
73 | 80 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftest-coverage -fprofile-arcs" ) | ||
74 | 81 | SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -ftest-coverage -fprofile-arcs" ) | ||
75 | 82 | SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -ftest-coverage -fprofile-arcs" ) | ||
76 | 83 | ENDIF(CMAKE_BUILD_TYPE MATCHES [cC][oO][vV][eE][rR][aA][gG][eE]) | ||
77 | 84 | 64 | ||
78 | 85 | option (DISABLE_ERROR_ON_LOCAL_TYPEDEFS_WARNINGS "Disable errors when local typedefs are unused" ON) | 65 | option (DISABLE_ERROR_ON_LOCAL_TYPEDEFS_WARNINGS "Disable errors when local typedefs are unused" ON) |
79 | 86 | if (DISABLE_ERROR_ON_LOCAL_TYPEDEFS_WARNINGS) | 66 | if (DISABLE_ERROR_ON_LOCAL_TYPEDEFS_WARNINGS) |
80 | @@ -96,9 +76,9 @@ | |||
81 | 96 | endif() | 76 | endif() |
82 | 97 | 77 | ||
83 | 98 | if (CLANG_FORMAT_COMMAND) | 78 | if (CLANG_FORMAT_COMMAND) |
87 | 99 | file(GLOB_RECURSE UBUNTU_LOCATION_SERVICE_INTERFACE_HEADER_FILES ${CMAKE_SOURCE_DIR}/include/*.h) | 79 | file(GLOB_RECURSE LOCATIOND_INTERFACE_HEADER_FILES ${CMAKE_SOURCE_DIR}/include/*.h) |
88 | 100 | file(GLOB_RECURSE UBUNTU_LOCATION_SERVICE_IMPLEMENTATION_FILES ${CMAKE_SOURCE_DIR}/src/*.h ${CMAKE_SOURCE_DIR}/src/*.cpp) | 80 | file(GLOB_RECURSE LOCATIOND_IMPLEMENTATION_FILES ${CMAKE_SOURCE_DIR}/src/*.h ${CMAKE_SOURCE_DIR}/src/*.cpp) |
89 | 101 | add_custom_target(formatcode ${CLANG_FORMAT_COMMAND} -i ${UBUNTU_LOCATION_SERVICE_INTERFACE_HEADER_FILES} ${UBUNTU_LOCATION_SERVICE_IMPLEMENTATION_FILES} SOURCES _clang-format) | 81 | add_custom_target(formatcode ${CLANG_FORMAT_COMMAND} -i ${LOCATIOND_INTERFACE_HEADER_FILES} ${LOCATIOND_IMPLEMENTATION_FILES} SOURCES _clang-format) |
90 | 102 | endif() | 82 | endif() |
91 | 103 | 83 | ||
92 | 104 | include_directories( | 84 | include_directories( |
93 | @@ -124,7 +104,7 @@ | |||
94 | 124 | ${CMAKE_BINARY_DIR}/src | 104 | ${CMAKE_BINARY_DIR}/src |
95 | 125 | ) | 105 | ) |
96 | 126 | 106 | ||
98 | 127 | file(GLOB_RECURSE UBUNTU_LOCATION_SERVICE_PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR} *.h) | 107 | file(GLOB_RECURSE LOCATIOND_PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR} *.h) |
99 | 128 | 108 | ||
100 | 129 | add_subdirectory(3rd-party/ichnaea) | 109 | add_subdirectory(3rd-party/ichnaea) |
101 | 130 | 110 | ||
102 | @@ -135,5 +115,3 @@ | |||
103 | 135 | add_subdirectory(po) | 115 | add_subdirectory(po) |
104 | 136 | add_subdirectory(src) | 116 | add_subdirectory(src) |
105 | 137 | add_subdirectory(tests) | 117 | add_subdirectory(tests) |
106 | 138 | |||
107 | 139 | enable_coverage_report(service) | ||
108 | 140 | 118 | ||
109 | === removed file 'cmake/EnableCoverageReport.cmake' | |||
110 | --- cmake/EnableCoverageReport.cmake 2013-05-29 09:21:16 +0000 | |||
111 | +++ cmake/EnableCoverageReport.cmake 1970-01-01 00:00:00 +0000 | |||
112 | @@ -1,153 +0,0 @@ | |||
113 | 1 | # - Creates a special coverage build type and target on GCC. | ||
114 | 2 | # | ||
115 | 3 | # Defines a function ENABLE_COVERAGE_REPORT which generates the coverage target | ||
116 | 4 | # for selected targets. Optional arguments to this function are used to filter | ||
117 | 5 | # unwanted results using globbing expressions. Moreover targets with tests for | ||
118 | 6 | # the source code can be specified to trigger regenerating the report if the | ||
119 | 7 | # test has changed | ||
120 | 8 | # | ||
121 | 9 | # ENABLE_COVERAGE_REPORT(TARGETS target... [FILTER filter...] [TESTS test targets...]) | ||
122 | 10 | # | ||
123 | 11 | # To generate a coverage report first build the project with | ||
124 | 12 | # CMAKE_BUILD_TYPE=coverage, then call make test and afterwards make coverage. | ||
125 | 13 | # | ||
126 | 14 | # The coverage report is based on gcov. Depending on the availability of lcov | ||
127 | 15 | # a HTML report will be generated and/or an XML report of gcovr is found. | ||
128 | 16 | # The generated coverage target executes all found solutions. Special targets | ||
129 | 17 | # exist to create e.g. only the xml report: coverage-xml. | ||
130 | 18 | # | ||
131 | 19 | # Copyright (C) 2010 by Johannes Wienke <jwienke at techfak dot uni-bielefeld dot de> | ||
132 | 20 | # | ||
133 | 21 | # This program is free software; you can redistribute it | ||
134 | 22 | # and/or modify it under the terms of the GNU General | ||
135 | 23 | # Public License as published by the Free Software Foundation; | ||
136 | 24 | # either version 2, or (at your option) | ||
137 | 25 | # any later version. | ||
138 | 26 | # | ||
139 | 27 | # This program is distributed in the hope that it will be useful, | ||
140 | 28 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
141 | 29 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
142 | 30 | # GNU General Public License for more details. | ||
143 | 31 | # | ||
144 | 32 | |||
145 | 33 | INCLUDE(ParseArguments) | ||
146 | 34 | |||
147 | 35 | FIND_PACKAGE(Lcov) | ||
148 | 36 | FIND_PACKAGE(gcovr) | ||
149 | 37 | |||
150 | 38 | FUNCTION(ENABLE_COVERAGE_REPORT) | ||
151 | 39 | |||
152 | 40 | # argument parsing | ||
153 | 41 | PARSE_ARGUMENTS(ARG "FILTER;TARGETS;TESTS" "" ${ARGN}) | ||
154 | 42 | |||
155 | 43 | SET(COVERAGE_RAW_FILE "${CMAKE_BINARY_DIR}/coverage.raw.info") | ||
156 | 44 | SET(COVERAGE_FILTERED_FILE "${CMAKE_BINARY_DIR}/coverage.info") | ||
157 | 45 | SET(COVERAGE_REPORT_DIR "${CMAKE_BINARY_DIR}/coveragereport") | ||
158 | 46 | SET(COVERAGE_XML_FILE "${CMAKE_BINARY_DIR}/coverage.xml") | ||
159 | 47 | SET(COVERAGE_XML_COMMAND_FILE "${CMAKE_BINARY_DIR}/coverage-xml.cmake") | ||
160 | 48 | |||
161 | 49 | # decide if there is any tool to create coverage data | ||
162 | 50 | SET(TOOL_FOUND FALSE) | ||
163 | 51 | IF(LCOV_FOUND OR GCOVR_FOUND) | ||
164 | 52 | SET(TOOL_FOUND TRUE) | ||
165 | 53 | ENDIF() | ||
166 | 54 | IF(NOT TOOL_FOUND) | ||
167 | 55 | MESSAGE(STATUS "Cannot enable coverage targets because neither lcov nor gcovr are found.") | ||
168 | 56 | ENDIF() | ||
169 | 57 | |||
170 | 58 | STRING(TOLOWER "${CMAKE_BUILD_TYPE}" COVERAGE_BUILD_TYPE) | ||
171 | 59 | IF(CMAKE_COMPILER_IS_GNUCXX AND TOOL_FOUND AND "${COVERAGE_BUILD_TYPE}" MATCHES "coverage") | ||
172 | 60 | |||
173 | 61 | MESSAGE(STATUS "Coverage support enabled for targets: ${ARG_TARGETS}") | ||
174 | 62 | |||
175 | 63 | # create coverage build type | ||
176 | 64 | SET(CMAKE_CXX_FLAGS_COVERAGE ${CMAKE_CXX_FLAGS_DEBUG} PARENT_SCOPE) | ||
177 | 65 | SET(CMAKE_C_FLAGS_COVERAGE ${CMAKE_C_FLAGS_DEBUG} PARENT_SCOPE) | ||
178 | 66 | SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_CONFIGURATION_TYPES} coverage PARENT_SCOPE) | ||
179 | 67 | |||
180 | 68 | # instrument targets | ||
181 | 69 | SET_TARGET_PROPERTIES(${ARG_TARGETS} PROPERTIES COMPILE_FLAGS --coverage | ||
182 | 70 | LINK_FLAGS --coverage) | ||
183 | 71 | |||
184 | 72 | # html report | ||
185 | 73 | IF (LCOV_FOUND) | ||
186 | 74 | |||
187 | 75 | MESSAGE(STATUS "Enabling HTML coverage report") | ||
188 | 76 | |||
189 | 77 | # set up coverage target | ||
190 | 78 | |||
191 | 79 | ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_RAW_FILE} | ||
192 | 80 | COMMAND ${LCOV_EXECUTABLE} -c -d ${CMAKE_BINARY_DIR} -o ${COVERAGE_RAW_FILE} | ||
193 | 81 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR} | ||
194 | 82 | COMMENT "Collecting coverage data" | ||
195 | 83 | DEPENDS ${ARG_TARGETS} ${ARG_TESTS} | ||
196 | 84 | VERBATIM) | ||
197 | 85 | |||
198 | 86 | # filter unwanted stuff | ||
199 | 87 | LIST(LENGTH ARG_FILTER FILTER_LENGTH) | ||
200 | 88 | IF(${FILTER_LENGTH} GREATER 0) | ||
201 | 89 | SET(FILTER COMMAND ${LCOV_EXECUTABLE}) | ||
202 | 90 | FOREACH(F ${ARG_FILTER}) | ||
203 | 91 | SET(FILTER ${FILTER} -r ${COVERAGE_FILTERED_FILE} ${F}) | ||
204 | 92 | ENDFOREACH() | ||
205 | 93 | SET(FILTER ${FILTER} -o ${COVERAGE_FILTERED_FILE}) | ||
206 | 94 | ELSE() | ||
207 | 95 | SET(FILTER "") | ||
208 | 96 | ENDIF() | ||
209 | 97 | |||
210 | 98 | ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_FILTERED_FILE} | ||
211 | 99 | COMMAND ${LCOV_EXECUTABLE} -e ${COVERAGE_RAW_FILE} "${CMAKE_SOURCE_DIR}*" -o ${COVERAGE_FILTERED_FILE} | ||
212 | 100 | ${FILTER} | ||
213 | 101 | DEPENDS ${COVERAGE_RAW_FILE} | ||
214 | 102 | COMMENT "Filtering recorded coverage data for project-relevant entries" | ||
215 | 103 | VERBATIM) | ||
216 | 104 | ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_REPORT_DIR} | ||
217 | 105 | COMMAND ${CMAKE_COMMAND} -E make_directory ${COVERAGE_REPORT_DIR} | ||
218 | 106 | COMMAND ${GENHTML_EXECUTABLE} --legend --show-details -t "${PROJECT_NAME} test coverage" -o ${COVERAGE_REPORT_DIR} ${COVERAGE_FILTERED_FILE} | ||
219 | 107 | DEPENDS ${COVERAGE_FILTERED_FILE} | ||
220 | 108 | COMMENT "Generating HTML coverage report in ${COVERAGE_REPORT_DIR}" | ||
221 | 109 | VERBATIM) | ||
222 | 110 | |||
223 | 111 | ADD_CUSTOM_TARGET(coverage-html | ||
224 | 112 | DEPENDS ${COVERAGE_REPORT_DIR}) | ||
225 | 113 | |||
226 | 114 | ENDIF() | ||
227 | 115 | |||
228 | 116 | # xml coverage report | ||
229 | 117 | IF(GCOVR_FOUND) | ||
230 | 118 | |||
231 | 119 | MESSAGE(STATUS "Enabling XML coverage report") | ||
232 | 120 | |||
233 | 121 | # gcovr cannot write directly to a file so the execution needs to | ||
234 | 122 | # be wrapped in a cmake file that generates the file output | ||
235 | 123 | FILE(WRITE ${COVERAGE_XML_COMMAND_FILE} | ||
236 | 124 | "SET(ENV{LANG} en)\n") | ||
237 | 125 | FILE(APPEND ${COVERAGE_XML_COMMAND_FILE} | ||
238 | 126 | "EXECUTE_PROCESS(COMMAND \"${GCOVR_EXECUTABLE}\" --exclude=tests.* --exclude=obj-.* --exclude=cmake.* -x -r \"${CMAKE_SOURCE_DIR}\" OUTPUT_FILE \"${COVERAGE_XML_FILE}\" WORKING_DIRECTORY \"${CMAKE_BINARY_DIR}\")\n") | ||
239 | 127 | |||
240 | 128 | ADD_CUSTOM_COMMAND(OUTPUT ${COVERAGE_XML_FILE} | ||
241 | 129 | COMMAND ${CMAKE_COMMAND} ARGS -P ${COVERAGE_XML_COMMAND_FILE} | ||
242 | 130 | COMMENT "Generating coverage XML report" | ||
243 | 131 | VERBATIM) | ||
244 | 132 | |||
245 | 133 | ADD_CUSTOM_TARGET(coverage-xml | ||
246 | 134 | DEPENDS ${COVERAGE_XML_FILE}) | ||
247 | 135 | |||
248 | 136 | ENDIF() | ||
249 | 137 | |||
250 | 138 | # provide a global coverage target executing both steps if available | ||
251 | 139 | SET(GLOBAL_DEPENDS "") | ||
252 | 140 | IF(LCOV_FOUND) | ||
253 | 141 | LIST(APPEND GLOBAL_DEPENDS ${COVERAGE_REPORT_DIR}) | ||
254 | 142 | ENDIF() | ||
255 | 143 | IF(GCOVR_FOUND) | ||
256 | 144 | LIST(APPEND GLOBAL_DEPENDS ${COVERAGE_XML_FILE}) | ||
257 | 145 | ENDIF() | ||
258 | 146 | IF(LCOV_FOUND OR GCOVR_FOUND) | ||
259 | 147 | ADD_CUSTOM_TARGET(coverage | ||
260 | 148 | DEPENDS ${GLOBAL_DEPENDS}) | ||
261 | 149 | ENDIF() | ||
262 | 150 | |||
263 | 151 | ENDIF() | ||
264 | 152 | |||
265 | 153 | ENDFUNCTION() | ||
266 | 154 | 0 | ||
267 | === removed file 'cmake/FindLcov.cmake' | |||
268 | --- cmake/FindLcov.cmake 2013-05-28 14:20:45 +0000 | |||
269 | +++ cmake/FindLcov.cmake 1970-01-01 00:00:00 +0000 | |||
270 | @@ -1,29 +0,0 @@ | |||
271 | 1 | # - Find lcov | ||
272 | 2 | # Will define: | ||
273 | 3 | # | ||
274 | 4 | # LCOV_EXECUTABLE - the lcov binary | ||
275 | 5 | # GENHTML_EXECUTABLE - the genhtml executable | ||
276 | 6 | # | ||
277 | 7 | # Copyright (C) 2010 by Johannes Wienke <jwienke at techfak dot uni-bielefeld dot de> | ||
278 | 8 | # | ||
279 | 9 | # This program is free software; you can redistribute it | ||
280 | 10 | # and/or modify it under the terms of the GNU General | ||
281 | 11 | # Public License as published by the Free Software Foundation; | ||
282 | 12 | # either version 2, or (at your option) | ||
283 | 13 | # any later version. | ||
284 | 14 | # | ||
285 | 15 | # This program is distributed in the hope that it will be useful, | ||
286 | 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
287 | 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
288 | 18 | # GNU General Public License for more details. | ||
289 | 19 | # | ||
290 | 20 | |||
291 | 21 | INCLUDE(FindPackageHandleStandardArgs) | ||
292 | 22 | |||
293 | 23 | FIND_PROGRAM(LCOV_EXECUTABLE lcov) | ||
294 | 24 | FIND_PROGRAM(GENHTML_EXECUTABLE genhtml) | ||
295 | 25 | |||
296 | 26 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lcov DEFAULT_MSG LCOV_EXECUTABLE GENHTML_EXECUTABLE) | ||
297 | 27 | |||
298 | 28 | # only visible in advanced view | ||
299 | 29 | MARK_AS_ADVANCED(LCOV_EXECUTABLE GENHTML_EXECUTABLE) | ||
300 | 30 | 0 | ||
301 | === removed file 'cmake/Findgcovr.cmake' | |||
302 | --- cmake/Findgcovr.cmake 2013-05-28 14:20:45 +0000 | |||
303 | +++ cmake/Findgcovr.cmake 1970-01-01 00:00:00 +0000 | |||
304 | @@ -1,31 +0,0 @@ | |||
305 | 1 | # - Find gcovr scrip | ||
306 | 2 | # Will define: | ||
307 | 3 | # | ||
308 | 4 | # GCOVR_EXECUTABLE - the gcovr script | ||
309 | 5 | # | ||
310 | 6 | # Uses: | ||
311 | 7 | # | ||
312 | 8 | # GCOVR_ROOT - root to search for the script | ||
313 | 9 | # | ||
314 | 10 | # Copyright (C) 2011 by Johannes Wienke <jwienke at techfak dot uni-bielefeld dot de> | ||
315 | 11 | # | ||
316 | 12 | # This program is free software; you can redistribute it | ||
317 | 13 | # and/or modify it under the terms of the GNU General | ||
318 | 14 | # Public License as published by the Free Software Foundation; | ||
319 | 15 | # either version 2, or (at your option) | ||
320 | 16 | # any later version. | ||
321 | 17 | # | ||
322 | 18 | # This program is distributed in the hope that it will be useful, | ||
323 | 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
324 | 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
325 | 21 | # GNU General Public License for more details. | ||
326 | 22 | # | ||
327 | 23 | |||
328 | 24 | INCLUDE(FindPackageHandleStandardArgs) | ||
329 | 25 | |||
330 | 26 | FIND_PROGRAM(GCOVR_EXECUTABLE gcovr HINTS ${GCOVR_ROOT} "${GCOVR_ROOT}/bin") | ||
331 | 27 | |||
332 | 28 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(gcovr DEFAULT_MSG GCOVR_EXECUTABLE) | ||
333 | 29 | |||
334 | 30 | # only visible in advanced view | ||
335 | 31 | MARK_AS_ADVANCED(GCOVR_EXECUTABLE) | ||
336 | 32 | 0 | ||
337 | === removed file 'cmake/ParseArguments.cmake' | |||
338 | --- cmake/ParseArguments.cmake 2013-05-28 14:20:45 +0000 | |||
339 | +++ cmake/ParseArguments.cmake 1970-01-01 00:00:00 +0000 | |||
340 | @@ -1,52 +0,0 @@ | |||
341 | 1 | # Parse arguments passed to a function into several lists separated by | ||
342 | 2 | # upper-case identifiers and options that do not have an associated list e.g.: | ||
343 | 3 | # | ||
344 | 4 | # SET(arguments | ||
345 | 5 | # hello OPTION3 world | ||
346 | 6 | # LIST3 foo bar | ||
347 | 7 | # OPTION2 | ||
348 | 8 | # LIST1 fuz baz | ||
349 | 9 | # ) | ||
350 | 10 | # PARSE_ARGUMENTS(ARG "LIST1;LIST2;LIST3" "OPTION1;OPTION2;OPTION3" ${arguments}) | ||
351 | 11 | # | ||
352 | 12 | # results in 7 distinct variables: | ||
353 | 13 | # * ARG_DEFAULT_ARGS: hello;world | ||
354 | 14 | # * ARG_LIST1: fuz;baz | ||
355 | 15 | # * ARG_LIST2: | ||
356 | 16 | # * ARG_LIST3: foo;bar | ||
357 | 17 | # * ARG_OPTION1: FALSE | ||
358 | 18 | # * ARG_OPTION2: TRUE | ||
359 | 19 | # * ARG_OPTION3: TRUE | ||
360 | 20 | # | ||
361 | 21 | # taken from http://www.cmake.org/Wiki/CMakeMacroParseArguments | ||
362 | 22 | |||
363 | 23 | MACRO(PARSE_ARGUMENTS prefix arg_names option_names) | ||
364 | 24 | SET(DEFAULT_ARGS) | ||
365 | 25 | FOREACH(arg_name ${arg_names}) | ||
366 | 26 | SET(${prefix}_${arg_name}) | ||
367 | 27 | ENDFOREACH(arg_name) | ||
368 | 28 | FOREACH(option ${option_names}) | ||
369 | 29 | SET(${prefix}_${option} FALSE) | ||
370 | 30 | ENDFOREACH(option) | ||
371 | 31 | |||
372 | 32 | SET(current_arg_name DEFAULT_ARGS) | ||
373 | 33 | SET(current_arg_list) | ||
374 | 34 | FOREACH(arg ${ARGN}) | ||
375 | 35 | SET(larg_names ${arg_names}) | ||
376 | 36 | LIST(FIND larg_names "${arg}" is_arg_name) | ||
377 | 37 | IF (is_arg_name GREATER -1) | ||
378 | 38 | SET(${prefix}_${current_arg_name} ${current_arg_list}) | ||
379 | 39 | SET(current_arg_name ${arg}) | ||
380 | 40 | SET(current_arg_list) | ||
381 | 41 | ELSE (is_arg_name GREATER -1) | ||
382 | 42 | SET(loption_names ${option_names}) | ||
383 | 43 | LIST(FIND loption_names "${arg}" is_option) | ||
384 | 44 | IF (is_option GREATER -1) | ||
385 | 45 | SET(${prefix}_${arg} TRUE) | ||
386 | 46 | ELSE (is_option GREATER -1) | ||
387 | 47 | SET(current_arg_list ${current_arg_list} ${arg}) | ||
388 | 48 | ENDIF (is_option GREATER -1) | ||
389 | 49 | ENDIF (is_arg_name GREATER -1) | ||
390 | 50 | ENDFOREACH(arg) | ||
391 | 51 | SET(${prefix}_${current_arg_name} ${current_arg_list}) | ||
392 | 52 | ENDMACRO(PARSE_ARGUMENTS) | ||
393 | 53 | 0 | ||
394 | === removed file 'cmake/PrePush.cmake' | |||
395 | --- cmake/PrePush.cmake 2013-05-28 14:20:45 +0000 | |||
396 | +++ cmake/PrePush.cmake 1970-01-01 00:00:00 +0000 | |||
397 | @@ -1,81 +0,0 @@ | |||
398 | 1 | ####################################################################### | ||
399 | 2 | # A convenience target that carries out the following steps: | ||
400 | 3 | # - Apply astyle to all source files of interest. | ||
401 | 4 | # - Build & test in a chroot, comparable setup to CI/Autolanding | ||
402 | 5 | # and ppa builders. Will fail if new files have not been added. | ||
403 | 6 | # - Build & test for android. | ||
404 | 7 | # | ||
405 | 8 | # NOTE: This target is very sensitive to the availability of all | ||
406 | 9 | # all required dependencies. For that, we prefer to fail the | ||
407 | 10 | # target if deps are missing to make the problem very visible. | ||
408 | 11 | # | ||
409 | 12 | # TODO: | ||
410 | 13 | # - Wire up the style-check target once we have reached a state | ||
411 | 14 | # where trunk actually passes the style check. | ||
412 | 15 | ####################################################################### | ||
413 | 16 | add_custom_target( | ||
414 | 17 | pre-push | ||
415 | 18 | |||
416 | 19 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
417 | 20 | ) | ||
418 | 21 | |||
419 | 22 | ####################################################################### | ||
420 | 23 | # Add target for running astyle with the correct options # | ||
421 | 24 | ####################################################################### | ||
422 | 25 | find_program(ASTYLE_EXECUTABLE astyle) | ||
423 | 26 | |||
424 | 27 | if (ASTYLE_EXECUTABLE) | ||
425 | 28 | add_custom_target( | ||
426 | 29 | astyle | ||
427 | 30 | ${ASTYLE_EXECUTABLE} --style=allman -s4 --indent=spaces=4 --pad-header --align-pointer=type --recursive ${CMAKE_SOURCE_DIR}/include/*.h | ||
428 | 31 | COMMAND ${ASTYLE_EXECUTABLE} --recursive --style=allman -s4 --indent=spaces=4 --pad-header --align-pointer=type ${CMAKE_SOURCE_DIR}/tests/*.cpp | ||
429 | 32 | VERBATIM | ||
430 | 33 | ) | ||
431 | 34 | endif (ASTYLE_EXECUTABLE) | ||
432 | 35 | |||
433 | 36 | ####################################################################### | ||
434 | 37 | # Add target for creating a source tarball with bzr export # | ||
435 | 38 | ####################################################################### | ||
436 | 39 | add_custom_target( | ||
437 | 40 | pre-push-source-tarball | ||
438 | 41 | |||
439 | 42 | COMMAND rm -rf pre-push-build-area | ||
440 | 43 | COMMAND mkdir pre-push-build-area | ||
441 | 44 | COMMAND bzr export --root pre-push pre-push-build-area/${PROJECT_NAME}_${DBUS_CPP_VERSION_MAJOR}.${DBUS_CPP_VERSION_MAJOR}.${DBUS_CPP_VERSION_MAJOR}.orig.tar.bz2 ${CMAKE_SOURCE_DIR} | ||
442 | 45 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR} | ||
443 | 46 | COMMENT "Preparing source tarball for pre-push build & test" | ||
444 | 47 | ) | ||
445 | 48 | |||
446 | 49 | ####################################################################### | ||
447 | 50 | # Add target for extracting source tarball for pdebuild # | ||
448 | 51 | ####################################################################### | ||
449 | 52 | add_custom_target( | ||
450 | 53 | extract-pre-push-tarball | ||
451 | 54 | COMMAND tar -xf {PROJECT_NAME}_${DBUS_CPP_VERSION_MAJOR}.${DBUS_CPP_VERSION_MAJOR}.${DBUS_CPP_VERSION_MAJOR}.orig.tar.bz2 | ||
452 | 55 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/pre-push-build-area VERBATIM | ||
453 | 56 | ) | ||
454 | 57 | |||
455 | 58 | ####################################################################### | ||
456 | 59 | # Builds & tests the last committed revision of the current branch # | ||
457 | 60 | ####################################################################### | ||
458 | 61 | find_program(PDEBUILD_EXECUTABLE pdebuild) | ||
459 | 62 | if(NOT PDEBUILD_EXECUTABLE) | ||
460 | 63 | message(STATUS "pdebuild NOT found, pre-push is going to FAIL") | ||
461 | 64 | endif() | ||
462 | 65 | |||
463 | 66 | add_custom_target( | ||
464 | 67 | pdebuild | ||
465 | 68 | COMMAND ${PDEBUILD_EXECUTABLE} | ||
466 | 69 | WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/pre-push-build-area/pre-push | ||
467 | 70 | COMMENT "Building & testing in chroot'd environment" | ||
468 | 71 | VERBATIM | ||
469 | 72 | ) | ||
470 | 73 | |||
471 | 74 | ####################################################################### | ||
472 | 75 | # pdebuild: make tarball -> extract to build area -> pdebuild # | ||
473 | 76 | # android-build: invoke cross-compile script # | ||
474 | 77 | ####################################################################### | ||
475 | 78 | add_dependencies(extract-pre-push-tarball pre-push-source-tarball) | ||
476 | 79 | add_dependencies(pdebuild extract-pre-push-tarball) | ||
477 | 80 | |||
478 | 81 | add_dependencies(pre-push pdebuild android-build) | ||
479 | 82 | 0 | ||
480 | === modified file 'data/ubuntu-location-service-connectivity.pc.in' | |||
481 | --- data/ubuntu-location-service-connectivity.pc.in 2014-05-19 12:07:44 +0000 | |||
482 | +++ data/ubuntu-location-service-connectivity.pc.in 2017-05-15 13:20:09 +0000 | |||
483 | @@ -6,7 +6,7 @@ | |||
484 | 6 | Name: ubuntu-location-service-connectivity | 6 | Name: ubuntu-location-service-connectivity |
485 | 7 | Description: A location service aggregating position/velocity/heading | 7 | Description: A location service aggregating position/velocity/heading |
486 | 8 | updates and exporting them over dbus, wifi and cell id query interfaces. | 8 | updates and exporting them over dbus, wifi and cell id query interfaces. |
488 | 9 | Version: @UBUNTU_LOCATION_SERVICE_VERSION_MAJOR@.@UBUNTU_LOCATION_SERVICE_VERSION_MINOR@.@UBUNTU_LOCATION_SERVICE_VERSION_PATCH@ | 9 | Version: @LOCATIOND_VERSION_MAJOR@.@LOCATIOND_VERSION_MINOR@.@LOCATIOND_VERSION_PATCH@ |
489 | 10 | Libs: -L${libdir} -lubuntu-location-service-connectivity | 10 | Libs: -L${libdir} -lubuntu-location-service-connectivity |
491 | 11 | Cflags: -I${includedir}/ubuntu-location-service-@UBUNTU_LOCATION_SERVICE_VERSION_MAJOR@ | 11 | Cflags: -I${includedir}/ubuntu-location-service-@LOCATIOND_VERSION_MAJOR@ |
492 | 12 | Requires: dbus-cpp | 12 | Requires: dbus-cpp |
493 | 13 | 13 | ||
494 | === modified file 'data/ubuntu-location-service.pc.in' | |||
495 | --- data/ubuntu-location-service.pc.in 2016-06-26 21:17:03 +0000 | |||
496 | +++ data/ubuntu-location-service.pc.in 2017-05-15 13:20:09 +0000 | |||
497 | @@ -6,6 +6,6 @@ | |||
498 | 6 | Name: @CMAKE_PROJECT_NAME@ | 6 | Name: @CMAKE_PROJECT_NAME@ |
499 | 7 | Description: A location service aggregating position/velocity/heading | 7 | Description: A location service aggregating position/velocity/heading |
500 | 8 | updates and exporting them over dbus. | 8 | updates and exporting them over dbus. |
502 | 9 | Version: @UBUNTU_LOCATION_SERVICE_VERSION_MAJOR@.@UBUNTU_LOCATION_SERVICE_VERSION_MINOR@.@UBUNTU_LOCATION_SERVICE_VERSION_PATCH@ | 9 | Version: @LOCATIOND_VERSION_MAJOR@.@LOCATIOND_VERSION_MINOR@.@LOCATIOND_VERSION_PATCH@ |
503 | 10 | Libs: -L${libdir} -lubuntu-location-service | 10 | Libs: -L${libdir} -lubuntu-location-service |
504 | 11 | Requires: dbus-cpp | 11 | Requires: dbus-cpp |
505 | 12 | 12 | ||
506 | === modified file 'src/location/CMakeLists.txt' | |||
507 | --- src/location/CMakeLists.txt 2017-05-12 07:43:46 +0000 | |||
508 | +++ src/location/CMakeLists.txt 2017-05-15 13:20:09 +0000 | |||
509 | @@ -43,7 +43,7 @@ | |||
510 | 43 | add_library( | 43 | add_library( |
511 | 44 | ubuntu-location-service SHARED | 44 | ubuntu-location-service SHARED |
512 | 45 | 45 | ||
514 | 46 | ${UBUNTU_LOCATION_SERVICE_PUBLIC_HEADERS} | 46 | ${LOCATIOND_PUBLIC_HEADERS} |
515 | 47 | 47 | ||
516 | 48 | fusion_provider_selection_policy.cpp | 48 | fusion_provider_selection_policy.cpp |
517 | 49 | non_selecting_provider_selection_policy.cpp | 49 | non_selecting_provider_selection_policy.cpp |
518 | @@ -182,8 +182,8 @@ | |||
519 | 182 | PROPERTIES | 182 | PROPERTIES |
520 | 183 | LINK_FLAGS "${ldflags} -Wl,--version-script,${symbol_map}" | 183 | LINK_FLAGS "${ldflags} -Wl,--version-script,${symbol_map}" |
521 | 184 | LINK_DEPENDS ${symbol_map} | 184 | LINK_DEPENDS ${symbol_map} |
524 | 185 | VERSION ${UBUNTU_LOCATION_SERVICE_VERSION_MAJOR}.${UBUNTU_LOCATION_SERVICE_VERSION_MINOR}.${UBUNTU_LOCATION_SERVICE_VERSION_PATCH} | 185 | VERSION ${LOCATIOND_VERSION_MAJOR}.${LOCATIOND_VERSION_MINOR}.${LOCATIOND_VERSION_PATCH} |
525 | 186 | SOVERSION ${UBUNTU_LOCATION_SERVICE_VERSION_MAJOR} | 186 | SOVERSION ${LOCATIOND_VERSION_MAJOR} |
526 | 187 | ) | 187 | ) |
527 | 188 | 188 | ||
528 | 189 | set_target_properties( | 189 | set_target_properties( |
529 | @@ -192,8 +192,8 @@ | |||
530 | 192 | PROPERTIES | 192 | PROPERTIES |
531 | 193 | LINK_FLAGS "${ldflags} -Wl,--version-script,${symbol_map}" | 193 | LINK_FLAGS "${ldflags} -Wl,--version-script,${symbol_map}" |
532 | 194 | LINK_DEPENDS ${symbol_map} | 194 | LINK_DEPENDS ${symbol_map} |
535 | 195 | VERSION ${UBUNTU_LOCATION_SERVICE_VERSION_MAJOR}.${UBUNTU_LOCATION_SERVICE_VERSION_MINOR}.${UBUNTU_LOCATION_SERVICE_VERSION_PATCH} | 195 | VERSION ${LOCATIOND_VERSION_MAJOR}.${LOCATIOND_VERSION_MINOR}.${LOCATIOND_VERSION_PATCH} |
536 | 196 | SOVERSION ${UBUNTU_LOCATION_SERVICE_VERSION_MAJOR} | 196 | SOVERSION ${LOCATIOND_VERSION_MAJOR} |
537 | 197 | ) | 197 | ) |
538 | 198 | 198 | ||
539 | 199 | add_definitions(${ENABLED_PROVIDER_TARGETS_DEFINITIONS}) | 199 | add_definitions(${ENABLED_PROVIDER_TARGETS_DEFINITIONS}) |
540 | 200 | 200 | ||
541 | === modified file 'src/location/config.h.in' | |||
542 | --- src/location/config.h.in 2016-07-13 14:06:18 +0000 | |||
543 | +++ src/location/config.h.in 2017-05-15 13:20:09 +0000 | |||
544 | @@ -20,10 +20,7 @@ | |||
545 | 20 | 20 | ||
546 | 21 | namespace location | 21 | namespace location |
547 | 22 | { | 22 | { |
552 | 23 | static constexpr const char* trust_store_service_name | 23 | |
549 | 24 | { | ||
550 | 25 | "@UBUNTU_LOCATION_SERVICE_TRUST_STORE_SERVICE_NAME@" | ||
551 | 26 | }; | ||
553 | 27 | } | 24 | } |
554 | 28 | 25 | ||
555 | 29 | #endif // LOCATION_CONFIG_H_ | 26 | #endif // LOCATION_CONFIG_H_ |
556 | 30 | 27 | ||
557 | === modified file 'tests/CMakeLists.txt' | |||
558 | --- tests/CMakeLists.txt 2017-05-09 12:06:57 +0000 | |||
559 | +++ tests/CMakeLists.txt 2017-05-15 13:20:09 +0000 | |||
560 | @@ -2,17 +2,6 @@ | |||
561 | 2 | 2 | ||
562 | 3 | add_definitions(-DCORE_DBUS_ENABLE_GOOGLE_TEST_FIXTURE -DBOOST_ASIO_DISABLE_MOVE) | 3 | add_definitions(-DCORE_DBUS_ENABLE_GOOGLE_TEST_FIXTURE -DBOOST_ASIO_DISABLE_MOVE) |
563 | 4 | 4 | ||
564 | 5 | option( | ||
565 | 6 | LOCATION_SERVICE_ENABLE_DBUS_TEST_RUNNER | ||
566 | 7 | "Rely on dbus test runner to start a private session for testing purposes" | ||
567 | 8 | ON | ||
568 | 9 | ) | ||
569 | 10 | |||
570 | 11 | if (LOCATION_SERVICE_ENABLE_DBUS_TEST_RUNNER) | ||
571 | 12 | find_program(DBUS_TEST_RUNNER_EXECUTABLE dbus-test-runner) | ||
572 | 13 | message(STATUS "Executing test suite under dbus-test-runner") | ||
573 | 14 | endif (LOCATION_SERVICE_ENABLE_DBUS_TEST_RUNNER) | ||
574 | 15 | |||
575 | 16 | # Build mongoose as static library to leverage in location reporter testing | 5 | # Build mongoose as static library to leverage in location reporter testing |
576 | 17 | add_library(mongoose mongoose.c) | 6 | add_library(mongoose mongoose.c) |
577 | 18 | # Explicitly select c99 when compiling mongoose | 7 | # Explicitly select c99 when compiling mongoose |
LGTM