Skip to content

Commit c2b69ea

Browse files
committed
Merge branch 'release-0.6.7' into release
2 parents 83d9437 + 49ca941 commit c2b69ea

File tree

114 files changed

+69791
-29630
lines changed

Some content is hidden

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

114 files changed

+69791
-29630
lines changed

3rd-party/proj/CMakeLists.txt

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -133,28 +133,15 @@ configure_file(proj-postinstall.in ${CMAKE_CURRENT_BINARY_DIR}/proj-postinstall)
133133

134134
# Exported configuration
135135

136-
# The following will not succeed during the initial configuration
137-
# but on repeated configuration after an successful build.
136+
set(PROJ4_ROOT "${INSTALL_DIR}" PARENT_SCOPE)
138137

139-
find_path(PROJ_INCLUDE_DIR NAMES proj_api.h PATHS
140-
"${INSTALL_DIR}/include"
141-
NO_DEFAULT_PATH
142-
NO_CMAKE_FIND_ROOT_PATH
143-
)
144-
mark_as_advanced(PROJ_INCLUDE_DIR)
145-
146-
find_library(PROJ_LIBRARY NAMES proj proj_i PATHS
147-
"${INSTALL_DIR}/lib"
148-
NO_DEFAULT_PATH
149-
NO_CMAKE_FIND_ROOT_PATH
150-
)
151-
mark_as_advanced(PROJ_LIBRARY)
138+
# Remove any left-over cache entries
139+
unset(PROJ4_ROOT CACHE)
140+
unset(PROJ4_INCLUDE_DIR CACHE)
141+
unset(PROJ4_LIBRARY CACHE)
142+
unset(PROJ4_LIBRARY_DEBUG CACHE)
143+
unset(PROJ4_LIBRARY_RELEASE CACHE)
152144

153-
if(PROJ_INCLUDE_DIR AND PROJ_LIBRARY)
154-
set(PROJ_BINARY_DIR "${INSTALL_DIR}/bin" PARENT_SCOPE)
155-
mark_as_advanced(PROJ_BINARY_DIR)
156-
set(PROJ_FOUND TRUE PARENT_SCOPE)
157-
endif()
158145

159146
# Don't let Xcode re-root the install
160147
set_target_properties(Proj PROPERTIES XCODE_ATTRIBUTE_INSTALL_ROOT "")

CMakeLists.txt

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ set(Mapper_VERSION_MAJOR 0)
3939
set(Mapper_VERSION_MINOR 6)
4040
if(NOT Mapper_VERSION_PATCH)
4141
# This can be configured when running cmake
42-
set(Mapper_VERSION_PATCH 6)
42+
set(Mapper_VERSION_PATCH 7)
4343
endif()
4444

4545
set(MAPPER_VERSION_PRI "${PROJECT_SOURCE_DIR}/oo-mapper-version.pri")
@@ -173,21 +173,26 @@ endif()
173173

174174
# Build definitons
175175

176-
include(CheckCXXCompilerFlag)
177-
check_cxx_compiler_flag("-std=c++11" std_cxx11)
178-
if(NOT std_cxx11)
179-
check_cxx_compiler_flag("-std=c++0x" std_cxx0x)
180-
endif()
181-
if(std_cxx11)
182-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
183-
elseif(std_cxx0x)
184-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
185-
elseif(CMAKE_COMPILER_IS_GNUXX)
186-
message(FATAL_ERROR "The compiler does not support C++11.")
176+
if(CMAKE_VERSION VERSION_GREATER 3.0.2)
177+
set(CMAKE_CXX_STANDARD 14)
178+
set(CMAKE_CXX_STANDARD_REQUIRED FALSE)
187179
else()
188-
message(FATAL_ERROR "The compiler support for C++11 is not known.")
180+
include(CheckCXXCompilerFlag)
181+
check_cxx_compiler_flag("-std=c++11" std_cxx11)
182+
if(NOT std_cxx11)
183+
check_cxx_compiler_flag("-std=c++0x" std_cxx0x)
184+
endif()
185+
if(std_cxx11)
186+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
187+
elseif(std_cxx0x)
188+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
189+
elseif(CMAKE_COMPILER_IS_GNUXX)
190+
message(FATAL_ERROR "The compiler does not support C++11.")
191+
else()
192+
message(FATAL_ERROR "The compiler support for C++11 is not known.")
193+
endif()
189194
endif()
190-
195+
191196
if(APPLE AND Mapper_MACOSX_VERSION)
192197
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -mmacosx-version-min=${Mapper_MACOSX_VERSION}")
193198
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=${Mapper_MACOSX_VERSION}")
@@ -211,17 +216,25 @@ set(Mapper_prerequisites_FOUND TRUE)
211216
if(Mapper_BUILD_CLIPPER)
212217
add_subdirectory(3rd-party/clipper)
213218
add_feature_info(Mapper_BUILD_CLIPPER 1 "version: ${CLIPPER_VERSION}")
219+
add_library(Polyclipping::Polyclipping ALIAS polyclipping)
214220
else()
215-
set(CLIPPER_VERSION 6.1.3a)
216-
find_package(Clipper MODULE REQUIRED)
221+
find_package(Polyclipping 6.1.3 MODULE REQUIRED)
217222
endif()
218223

219224
if(Mapper_BUILD_PROJ)
220225
add_subdirectory(3rd-party/proj)
221226
add_dependencies(Mapper_prerequisites Proj)
222227
add_feature_info(Mapper_BUILD_PROJ 1 "version: ${PROJ_VERSION}")
228+
find_package(PROJ4 MODULE QUIET)
223229
else()
224-
find_package(Proj REQUIRED)
230+
find_package(PROJ4 CONFIG QUIET)
231+
if(NOT TARGET PROJ4::proj)
232+
set(PROJ4_FOUND false)
233+
find_package(PROJ4 MODULE REQUIRED)
234+
endif()
235+
endif()
236+
if(NOT PROJ4_FOUND)
237+
set(Mapper_prerequisites_FOUND FALSE)
225238
endif()
226239

227240
if(Mapper_BUILD_GDAL)
@@ -263,8 +276,6 @@ endif()
263276

264277
add_definitions(-D_USE_MATH_DEFINES -DUNICODE)
265278

266-
include_directories(${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR} ${PROJ_INCLUDE_DIR})
267-
268279
if(Mapper_DEVELOPMENT_BUILD)
269280
add_definitions(-DMAPPER_DEVELOPMENT_BUILD)
270281
include(EnableSanitize)

android/AndroidManifest.xml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.6.6" android:versionCode="606" package="org.openorienteering.mapper" android:installLocation="auto">
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="0.6.7" android:versionCode="607" package="org.openorienteering.mapper" android:installLocation="auto">
33
<application android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="@string/long_app_name" android:icon="@drawable/icon">
44
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation"
55
android:name="org.openorienteering.mapper.MapperActivity"
@@ -9,17 +9,26 @@
99
<action android:name="android.intent.action.MAIN"/>
1010
<category android:name="android.intent.category.LAUNCHER"/>
1111
</intent-filter>
12-
<intent-filter android:label="@string/app_name" android:icon="@drawable/icon" android:priority="1">
12+
<intent-filter android:priority="1">
1313
<action android:name="android.intent.action.VIEW"/>
1414
<action android:name="android.intent.action.EDIT"/>
1515
<category android:name="android.intent.category.DEFAULT"/>
1616
<category android:name="android.intent.category.BROWSABLE"/>
17-
<data android:scheme="file"/>
18-
<data android:host="*"/>
19-
<data android:mimeType="*/*"/>
20-
<data android:pathPattern=".*\\.omap"/>
21-
<data android:pathPattern=".*\\.xmap"/>
22-
<data android:pathPattern=".*\\.ocd"/>
17+
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\.omap"/>
18+
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\..*\\.omap"/>
19+
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\..*\\..*\\.omap"/>
20+
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\..*\\..*\\..*\\.omap"/>
21+
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\..*\\..*\\..*\\..*\\.omap"/>
22+
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\.xmap"/>
23+
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\..*\\.xmap"/>
24+
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\..*\\..*\\.xmap"/>
25+
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\..*\\..*\\..*\\.xmap"/>
26+
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\..*\\..*\\..*\\..*\\.xmap"/>
27+
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\.ocd"/>
28+
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\..*\\.ocd"/>
29+
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\..*\\..*\\.ocd"/>
30+
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\..*\\..*\\..*\\.ocd"/>
31+
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\..*\\..*\\..*\\..*\\.ocd"/>
2332
</intent-filter>
2433
<meta-data android:value="Mapper" android:name="android.app.lib_name"/>
2534
<meta-data android:resource="@array/qt_sources" android:name="android.app.qt_sources_resource_id"/>

android/src/org/openorienteering/mapper/MapperActivity.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,30 @@ public void onCreate(Bundle savedInstanceState)
5858
instance = this;
5959
}
6060

61+
/** Call setIntent, as recommended for singleTask launch mode. */
62+
@Override
63+
public void onNewIntent(Intent intent)
64+
{
65+
setIntent(intent);
66+
}
67+
68+
/** Returns the data string from the intent, and resets the intent. */
69+
public String takeIntentPath()
70+
{
71+
String result = "";
72+
Intent intent = getIntent();
73+
if (intent != null)
74+
{
75+
String action = intent.getAction();
76+
if (action == Intent.ACTION_EDIT || action == Intent.ACTION_VIEW)
77+
{
78+
result = intent.getDataString();
79+
}
80+
setIntent(null);
81+
}
82+
return result;
83+
}
84+
6185
// Static methods to be called from C++
6286

6387
/** Checks if GPS is enabled in the Android settings and if not, prompts the user to enable it.

cmake/FindClipper.cmake

Lines changed: 0 additions & 44 deletions
This file was deleted.

cmake/FindPROJ4.cmake

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
#.rst:
2+
# FindPROJ4
3+
# --------
4+
#
5+
# Find the proj includes and library.
6+
#
7+
# IMPORTED Targets
8+
# ^^^^^^^^^^^^^^^^
9+
#
10+
# This module defines :prop_tgt:`IMPORTED` target ``PROJ4::proj``,
11+
# if Proj.4 has been found.
12+
#
13+
# Result Variables
14+
# ^^^^^^^^^^^^^^^^
15+
#
16+
# This module defines the following variables:
17+
#
18+
# ::
19+
#
20+
# PROJ4_INCLUDE_DIRS - where to find proj_api.h, etc.
21+
# PROJ4_LIBRARIES - List of libraries when using libproj.
22+
# PROJ4_FOUND - True if libproj found.
23+
#
24+
# ::
25+
#
26+
# PROJ4_VERSION - The version of libproj found (x.y.z)
27+
# PROJ4_VERSION_MAJOR - The major version of libproj
28+
# PROJ4_VERSION_MINOR - The minor version of libproj
29+
# PROJ4_VERSION_PATCH - The patch version of libproj
30+
# PROJ4_VERSION_TWEAK - always 0
31+
# PROJ4_VERSION_COUNT - The number of version components, always 3
32+
#
33+
# Hints
34+
# ^^^^^
35+
#
36+
# A user may set ``PROJ4_ROOT`` to a libproj installation root to tell this
37+
# module where to look exclusively.
38+
39+
#=============================================================================
40+
# Copyright 2016 Kai Pastor
41+
#
42+
#
43+
# This file was derived from CMake 3.5's module FindZLIB.cmake
44+
# which has the following terms:
45+
#
46+
# Copyright 2001-2011 Kitware, Inc.
47+
#
48+
# Redistribution and use in source and binary forms, with or without
49+
# modification, are permitted provided that the following conditions are
50+
# met:
51+
#
52+
# * Redistributions of source code must retain the above copyright notice,
53+
# this list of conditions and the following disclaimer.
54+
#
55+
# * Redistributions in binary form must reproduce the above copyright notice,
56+
# this list of conditions and the following disclaimer in the documentation
57+
# and/or other materials provided with the distribution.
58+
#
59+
# * The names of Kitware, Inc., the Insight Consortium, or the names of
60+
# any consortium members, or of any contributors, may not be used to
61+
# endorse or promote products derived from this software without
62+
# specific prior written permission.
63+
#
64+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
65+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
66+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
67+
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
68+
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
69+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
70+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
71+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
72+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
73+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
74+
#=============================================================================
75+
76+
# Search PROJ4_ROOT exclusively if it is set.
77+
if(PROJ4_ROOT)
78+
set(_PROJ4_SEARCH PATHS ${PROJ4_ROOT} NO_DEFAULT_PATH)
79+
else()
80+
set(_PROJ4_SEARCH)
81+
endif()
82+
83+
find_path(PROJ4_INCLUDE_DIR NAMES proj_api.h ${_PROJ4_SEARCH} PATH_SUFFIXES include)
84+
mark_as_advanced(PROJ4_INCLUDE_DIR)
85+
86+
if(PROJ4_INCLUDE_DIR AND EXISTS "${PROJ4_INCLUDE_DIR}/proj_api.h")
87+
file(STRINGS "${PROJ4_INCLUDE_DIR}/proj_api.h" PROJ4_H REGEX "^#define PJ_VERSION [0-9]+$")
88+
89+
string(REGEX REPLACE "^.*PJ_VERSION ([0-9]).*$" "\\1" PROJ4_VERSION_MAJOR "${PROJ4_H}")
90+
string(REGEX REPLACE "^.*PJ_VERSION [0-9]([0-9]).*$" "\\1" PROJ4_VERSION_MINOR "${PROJ4_H}")
91+
string(REGEX REPLACE "^.*PJ_VERSION [0-9][0-9]([0-9]).*$" "\\1" PROJ4_VERSION_PATCH "${PROJ4_H}")
92+
set(PROJ4_VERSION "${PROJ4_VERSION_MAJOR}.${PROJ4_VERSION_MINOR}.${PROJ4_VERSION_PATCH}")
93+
set(PROJ4_VERSION_COUNT 3)
94+
endif()
95+
96+
# Allow PROJ4_LIBRARY to be set manually, as the location of the proj library
97+
if(NOT PROJ4_LIBRARY)
98+
set(PROJ4_NAMES proj)
99+
set(PROJ4_NAMES_DEBUG projd)
100+
if(WIN32 AND DEFINED PROJ4_VERSION_MAJOR AND DEFINED PROJ4_VERSION_MINOR)
101+
list(APPEND PROJ4_NAMES proj_${PROJ4_VERSION_MAJOR}_${PROJ4_VERSION_MINOR})
102+
list(APPEND PROJ4_NAMES projd_${PROJ4_VERSION_MAJOR}_${PROJ4_VERSION_MINOR})
103+
endif()
104+
find_library(PROJ4_LIBRARY_RELEASE NAMES ${PROJ4_NAMES} ${_PROJ4_SEARCH} PATH_SUFFIXES lib)
105+
find_library(PROJ4_LIBRARY_DEBUG NAMES ${PROJ4_NAMES_DEBUG} ${_PROJ4_SEARCH} PATH_SUFFIXES lib)
106+
include(SelectLibraryConfigurations)
107+
select_library_configurations(PROJ4)
108+
endif()
109+
110+
# handle the QUIETLY and REQUIRED arguments and set PROJ4_FOUND to TRUE if
111+
# all listed variables are TRUE
112+
include(FindPackageHandleStandardArgs)
113+
find_package_handle_standard_args(PROJ4
114+
REQUIRED_VARS
115+
PROJ4_LIBRARY
116+
PROJ4_INCLUDE_DIR
117+
VERSION_VAR
118+
PROJ4_VERSION
119+
)
120+
121+
if(PROJ4_FOUND)
122+
set(PROJ4_INCLUDE_DIRS ${PROJ4_INCLUDE_DIR})
123+
124+
if(NOT PROJ4_LIBRARIES)
125+
set(PROJ4_LIBRARIES ${PROJ4_LIBRARY})
126+
endif()
127+
128+
if(NOT TARGET PROJ4::proj)
129+
add_library(PROJ4::proj UNKNOWN IMPORTED)
130+
set_target_properties(PROJ4::proj PROPERTIES
131+
INTERFACE_INCLUDE_DIRECTORIES "${PROJ4_INCLUDE_DIRS}")
132+
133+
if(PROJ4_LIBRARY_RELEASE)
134+
set_property(TARGET PROJ4::proj APPEND PROPERTY
135+
IMPORTED_CONFIGURATIONS RELEASE)
136+
set_target_properties(PROJ4::proj PROPERTIES
137+
IMPORTED_LOCATION_RELEASE "${PROJ4_LIBRARY_RELEASE}")
138+
endif()
139+
140+
if(PROJ4_LIBRARY_DEBUG)
141+
set_property(TARGET PROJ4::proj APPEND PROPERTY
142+
IMPORTED_CONFIGURATIONS DEBUG)
143+
set_target_properties(PROJ4::proj PROPERTIES
144+
IMPORTED_LOCATION_DEBUG "${PROJ4_LIBRARY_DEBUG}")
145+
endif()
146+
147+
if(NOT PROJ4_LIBRARY_RELEASE AND NOT PROJ4_LIBRARY_DEBUG)
148+
set_property(TARGET PROJ4::proj APPEND PROPERTY
149+
IMPORTED_LOCATION "${PROJ4_LIBRARY}")
150+
endif()
151+
endif()
152+
endif()

0 commit comments

Comments
 (0)