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