Skip to content

Commit 5611e99

Browse files
authored
Merge master as of v0.9.0
2 parents be39fc0 + 608eb9e commit 5611e99

File tree

517 files changed

+221088
-140132
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

517 files changed

+221088
-140132
lines changed

.clang-tidy

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
Checks: >-
2+
*,
3+
-bugprone-integer-division,
4+
-bugprone-narrowing-conversions,
5+
-bugprone-too-small-loop-variable,
6+
-cert-dcl16-c,
7+
-cert-err58-cpp,
8+
-cert-flp30-c,
9+
-clang-analyzer-cplusplus.Move,
10+
-cppcoreguidelines-avoid-c-arrays,
11+
-cppcoreguidelines-avoid-magic-numbers,
12+
-cppcoreguidelines-macro-usage,
13+
-cppcoreguidelines-narrowing-conversions,
14+
-cppcoreguidelines-non-private-member-variables-in-classes,
15+
-cppcoreguidelines-owning-memory,
16+
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
17+
-cppcoreguidelines-pro-bounds-constant-array-index,
18+
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
19+
-cppcoreguidelines-pro-type-const-cast,
20+
-cppcoreguidelines-pro-type-member-init,
21+
-cppcoreguidelines-pro-type-reinterpret-cast,
22+
-cppcoreguidelines-pro-type-static-cast-downcast,
23+
-cppcoreguidelines-pro-type-union-access,
24+
-cppcoreguidelines-pro-type-vararg,
25+
-cppcoreguidelines-special-member-functions,
26+
-fuchsia*,
27+
-google*,
28+
-hicpp*,
29+
-llvm*,
30+
-misc-non-private-member-variables-in-classes,
31+
-modernize-avoid-c-arrays,
32+
-modernize-make-unique,
33+
-modernize-pass-by-value,
34+
-modernize-raw-string-literal,
35+
-modernize-return-braced-init-list,
36+
-modernize-use-auto,
37+
-modernize-use-default-member-init,
38+
-modernize-use-emplace,
39+
-modernize-use-equals-default,
40+
-modernize-use-nullptr,
41+
-modernize-use-using,
42+
-performance-move-const-arg,
43+
-performance-type-promotion-in-math-fn,
44+
-performance-unnecessary-copy-initialization,
45+
-performance-unnecessary-value-param,
46+
-readability-braces-around-statements,
47+
-readability-const-return-type,
48+
-readability-container-size-empty,
49+
-readability-delete-null-pointer,
50+
-readability-else-after-return,
51+
-readability-implicit-bool-conversion,
52+
-readability-inconsistent-declaration-parameter-name,
53+
-readability-isolate-declaration,
54+
-readability-magic-numbers,
55+
-readability-misleading-indentation,
56+
-readability-non-const-parameter,
57+
-readability-redundant-control-flow,
58+
-readability-redundant-declaration,
59+
-readability-redundant-member-init,
60+
-readability-simplify-boolean-expr,
61+
-readability-static-accessed-through-instance,
62+
-readability-static-definition-in-anonymous-namespace,
63+
-readability-uppercase-literal-suffix,
64+
65+
CheckOptions:
66+
- key: AllowIntegerConditions
67+
value: 1
68+
- key: AllowPointerConditions
69+
value: 1
70+
71+
HeaderFilterRegex: '^(.*/|)[^q][^/]*$'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ build*/
99
help/*.qhc
1010
3rd-party/*/download
1111
!3rd-party/*/download/README.txt
12+
packaging/android/Mapper

3rd-party/clipper/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,6 @@ set_source_files_properties(${CLIPPER_SOURCES} PROPERTIES GENERATED TRUE)
120120

121121
add_library(polyclipping STATIC ${CLIPPER_SOURCES})
122122

123-
target_include_directories(polyclipping PUBLIC ${SOURCE_DIR}/cpp)
123+
target_include_directories(polyclipping SYSTEM PUBLIC ${SOURCE_DIR}/cpp)
124124

125125
add_dependencies(polyclipping Clipper)

3rd-party/qtsingleapplication/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ add_library(QtSingleApplication STATIC
3434
)
3535

3636
target_include_directories(QtSingleApplication
37+
SYSTEM
3738
INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/src"
3839
)
3940

CMakeLists.txt

Lines changed: 66 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#
22
# Copyright 2012, 2013, 2014 Thomas Schöps
3-
# Copyright 2012-2018 Kai Pastor
3+
# Copyright 2012-2019 Kai Pastor
44
#
55
# This file is part of OpenOrienteering.
66
#
@@ -29,7 +29,9 @@ endif()
2929

3030
# Project declaration
3131

32-
project(Mapper VERSION 0.8.4 LANGUAGES CXX C)
32+
project(Mapper VERSION 0.9.0 LANGUAGES CXX C)
33+
34+
math(EXPR Mapper_VERSION_CODE "${Mapper_VERSION_MAJOR} * 10000 + ${Mapper_VERSION_MINOR} * 100 + ${Mapper_VERSION_PATCH} * 2 + ${CMAKE_SIZEOF_VOID_P} / 4 - 1")
3335

3436
if(Mapper_VERSION_DISPLAY)
3537
message(STATUS "Custom version display string: \"${Mapper_VERSION_DISPLAY}\"")
@@ -41,16 +43,6 @@ endif()
4143

4244
set(Mapper_COPYRIGHT "(C) 2012-2018 The OpenOrienteering developers")
4345

44-
set(android_manifest "${PROJECT_SOURCE_DIR}/android/AndroidManifest.xml")
45-
file(READ "${android_manifest}" current)
46-
if(NOT current MATCHES " android:versionName=.${Mapper_VERSION_MAJOR}\\.${Mapper_VERSION_MINOR}\\.${Mapper_VERSION_PATCH}. ")
47-
set(android_version_name "${Mapper_VERSION_MAJOR}.${Mapper_VERSION_MINOR}.${Mapper_VERSION_PATCH}")
48-
math(EXPR android_version_int "${Mapper_VERSION_MAJOR} * 10000 + ${Mapper_VERSION_MINOR} * 100 + ${Mapper_VERSION_PATCH}")
49-
string(REGEX REPLACE "( android:versionName=.)[0-9]*\\.[0-9]*\\.[0-9]*(. )" "\\1${android_version_name}\\2" output "${current}")
50-
string(REGEX REPLACE "( android:versionCode=.)[0-9]*(. )" "\\1${android_version_int}\\2" output "${output}")
51-
file(WRITE "${android_manifest}" "${output}")
52-
endif()
53-
5446
if(${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${PROJECT_SOURCE_DIR})
5547
message(AUTHOR_WARNING "In-source builds are discouraged for development.")
5648
endif()
@@ -109,17 +101,6 @@ option(Mapper_PACKAGE_ASSISTANT "Include Qt Assistant in the packages"
109101
mark_as_advanced(Mapper_PACKAGE_PROJ Mapper_PACKAGE_GDAL Mapper_PACKAGE_QT Mapper_PACKAGE_ASSISTANT)
110102

111103

112-
# Migration of legacy configurations (before 0.7, affects developers)
113-
114-
if(Mapper_BUILD_DOXYGEN)
115-
unset(DOXYGEN_EXECUTABLE CACHE)
116-
endif()
117-
unset(Mapper_BUILD_DOXYGEN CACHE)
118-
unset(Mapper_BUILD_GDAL CACHE)
119-
unset(Mapper_BUILD_PROJ CACHE)
120-
unset(Mapper_BUILD_QT CACHE)
121-
122-
123104
# Installation configuration
124105

125106
set(Mapper_PACKAGE_NAME "openorienteering-mapper" CACHE STRING
@@ -162,6 +143,8 @@ endif()
162143

163144
# Build definitons
164145

146+
include(CTest)
147+
165148
set(CMAKE_CXX_STANDARD 14)
166149
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
167150

@@ -196,11 +179,23 @@ if(NOT TARGET PROJ4::proj)
196179
set(PROJ4_FOUND false)
197180
find_package(PROJ4 MODULE REQUIRED)
198181
endif()
182+
if(NOT PROJ4_VERSION OR PROJ4_VERSION VERSION_LESS 6.1)
183+
# New PROJ API missing or incomplete.
184+
# (proj_normalize_for_visualization() came in 6.1.)
185+
add_definitions(-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H)
186+
endif()
199187

200188
if(Mapper_USE_GDAL)
201-
find_package(GDAL REQUIRED)
189+
find_package(GDAL 2 REQUIRED)
202190
endif()
203191

192+
find_package(Qt5Core 5.5 REQUIRED)
193+
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050500)
194+
if (ANDROID AND "${Qt5Core_VERSION}" VERSION_LESS 5.12.1)
195+
message(FATAL_ERROR "At least Qt 5.12.1 is required to build for Android")
196+
elseif ("${Qt5Core_VERSION}" VERSION_LESS 5.8.0)
197+
add_definitions("-D'Q_FALLTHROUGH()=(void)0'")
198+
endif()
204199

205200
include("TestBigEndian")
206201
test_big_endian(big_endian)
@@ -209,10 +204,6 @@ if(big_endian)
209204
endif()
210205

211206

212-
if(ANDROID OR big_endian)
213-
add_definitions(-DNO_NATIVE_FILE_FORMAT)
214-
endif()
215-
216207
if(UNIX AND NOT APPLE)
217208
# set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib/${Mapper_PACKAGE_NAME}/lib")
218209
set(CMAKE_INSTALL_RPATH "${MAPPER_LIBRARY_DESTINATION}/lib")
@@ -229,6 +220,30 @@ else()
229220
add_definitions(-DQT_NO_DEBUG -DQT_NO_DEBUG_OUTPUT -DQT_NO_WARNING_OUTPUT -DNDEBUG)
230221
endif()
231222

223+
224+
# Build-time code checks
225+
226+
if(NOT CMAKE_CXX_CLANG_TIDY)
227+
set(min_version 8)
228+
find_package(ClangTidy ${min_version})
229+
if(ClangTidy_FOUND)
230+
set(CMAKE_CXX_CLANG_TIDY "${PROJECT_SOURCE_DIR}/code-check-wrapper.sh;${ClangTidy_EXECUTABLE}")
231+
else()
232+
message(AUTHOR_WARNING "Install clang-tidy >= ${min_version} for code checks during build")
233+
endif()
234+
endif()
235+
236+
if(NOT CMAKE_CXX_INCLUDE_WHAT_YOU_USE)
237+
set(min_version 0.12)
238+
find_package(IWYU ${min_version})
239+
if(IWYU_FOUND)
240+
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE "${PROJECT_SOURCE_DIR}/code-check-wrapper.sh;${IWYU_EXECUTABLE}")
241+
else()
242+
message(AUTHOR_WARNING "Install include-what-you-use >= ${min_version} for code checks during build")
243+
endif()
244+
endif()
245+
246+
232247
# Subdirectories
233248

234249
add_subdirectory("doc/manual")
@@ -246,6 +261,7 @@ add_subdirectory("src/libocad")
246261
if(NOT ANDROID)
247262
add_subdirectory("src/printsupport")
248263
endif()
264+
add_subdirectory("src/sensors")
249265
add_subdirectory("src")
250266
add_subdirectory("packaging")
251267
add_subdirectory("doc/licensing")
@@ -262,7 +278,28 @@ endif()
262278
add_subdirectory("doc/api")
263279
add_subdirectory("packaging/src")
264280

265-
feature_summary(WHAT ALL)
281+
# Auxiliary targets
282+
283+
set(ci
284+
ci/azure-pipelines.yml
285+
ci/build.yml
286+
ci/codespell.yml
287+
ci/filter-stderr.sed
288+
ci/publish.yml
289+
ci/publish-coverage.yml
290+
ci/setup-common.yml
291+
ci/setup-macos.yml
292+
ci/setup-msys2.yml
293+
ci/setup-ubuntu.yml
294+
ci/shell.sh
295+
ci/openorienteering-mapper-ci.cmake
296+
)
297+
298+
add_custom_target(CI SOURCES ${ci})
299+
300+
# Configuration report
301+
302+
feature_summary(INCLUDE_QUIET_PACKAGES WHAT ALL)
266303

267304
string(TOUPPER "${CMAKE_BUILD_TYPE}" type)
268305
foreach(lang CXX C)

INSTALL.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ This document is about building OpenOrienteering Mapper from source code.
44

55
The general build process prerequisites are:
66
- A supported platform:
7-
- Linux. Ubuntu 16.04 is known to work.
8-
Linux is also used to cross-compile for Windows and Android.
9-
- OS X Yosemite (10.10). OS X Mountain Lion (10.8) or newer may work.
10-
(Qt supports Mac OS X Lion (10.7) for deployment only until Qt 5.6.)
7+
- Linux. Ubuntu 18.04 is known to work.
8+
Linux is also used to cross-compile for Android.
9+
- macOS: 10.13 is known to work.
10+
- Windows: MSYS2 (MinGW subsystem).
1111
- CMake >= 3.1.
1212
CMake is available from https://cmake.org/.
1313
- A supported C++ compiler toolchain. C++14 is mandatory.
1414

1515
Mapper has a number of direct and indirect dependencies on third-party
1616
components. Direct dependencies are:
17-
- Qt >=5.3
17+
- Qt >=5.5
1818
https://www.qt.io/download-open-source/
19-
- Clipper library (aka libpolyclipping) >= 6.1.3.a
19+
- Clipper library (aka libpolyclipping) >= 6.1.3a
2020
http://www.angusj.com/delphi/clipper.php
21-
- PROJ.4 Cartographic Projections Library >= 4.8
21+
- PROJ Cartographic Projections Library >= 4.9
2222
https://proj4.org/
23-
- GDAL Geospatial Data Abstraction Library
23+
- GDAL Geospatial Data Abstraction Library >= 2
2424
https://www.gdal.org/
2525
- ZLib Compression Library
2626
https://zlib.net/
@@ -32,7 +32,7 @@ For target systems other than desktop Linux, the recommended way to deal
3232
with the dependencies is to use the OpenOrienteering superbuild project
3333
(https://github.com/OpenOrienteering/superbuild). See below for details.
3434

35-
The recommented integrated development environment (IDE) is Qt Creator
35+
The recommended integrated development environment (IDE) is Qt Creator
3636
which is available from https://www.qt.io/download-open-source/.
3737

3838

@@ -52,7 +52,7 @@ git clone https://github.com/OpenOrienteering/mapper.git
5252

5353
## Compiling for Linux (without OpenOrienteering superbuild)
5454

55-
The standard g++ (>= 4.9) compiler from a recent distribution should work. Make
55+
The standard g++ (>= 5.0) compiler from a recent distribution should work. Make
5656
sure that the required development and tool packages are installed. For a Ubuntu
5757
or Debian system, install:
5858
```
@@ -125,8 +125,7 @@ In addition to the general build process prerequisites, you need:
125125
The OpenOrienteering superbuild project will download and install this software
126126
when it creates an android toolchain.
127127

128-
Qt 5.6 requires at least API Level 9 to work. Apps built for the armeabi-v7a
129-
ABI require at least an emulator image of API level 14.
128+
Qt 5.12 requires at least API Level 16 to work.
130129

131130
The build of OpenOrienteering Mapper for Android is done by CMake, too.
132131
However, the cmake-generated build creates a qmake project in
@@ -135,7 +134,7 @@ deployment settings generated by qmake for this project, you this project is
135134
suitable for convenient deplyoing and debugging Mapper in Qt Creator.
136135

137136
Note that release APKs need to be signed, and the signing key cannot change for
138-
replacing an installed app without loosing the data (maps) stored for this app.
137+
replacing an installed app without losing the data (maps) stored for this app.
139138
To facilitate development, debug builds of Mapper use a different namespace and
140139
name.
141140

@@ -156,4 +155,4 @@ available together with the release binaries.
156155
Packages for macOS and Windows are built using CPack which comes with CMake.
157156
Android APKs are build in the same way, although not using a CPack generator.
158157
These packages bundle all 3rd-party components (Qt binaries and translations,
159-
PROJ.4 and GDAL binaries and data, etc.).
158+
PROJ and GDAL binaries and data, etc.).

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
OpenOrienteering Mapper is an orienteering mapmaking program and provides
66
a free and open source alternative to existing commercial software.
7-
OpenOrienteering Mapper runs on Android, Windows, Mac OS X and Linux.
7+
OpenOrienteering Mapper runs on Android, Windows, macOS and Linux.
88

99
- [Mapper Homepage](https://www.openorienteering.org/apps/mapper/)
1010
- [Manual](https://www.openorienteering.org/mapper-manual/)

0 commit comments

Comments
 (0)