Skip to content

Commit 3c943cf

Browse files
authored
Revise cove cmake and copyright (GH-1474)
Fix feature activation, actually allow the feature to be activated on Android. Add cove to feature summary. Link cove when it is a target. Pass include dir via target. Pass WITH_COVE via target. Display potrace copyright.
1 parent 55925df commit 3c943cf

File tree

5 files changed

+45
-9
lines changed

5 files changed

+45
-9
lines changed

3rd-party/cove/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ set(Cove_SRCS
5151
)
5252

5353
add_library(cove STATIC ${Cove_SRCS})
54+
target_compile_definitions(cove INTERFACE WITH_COVE)
55+
target_include_directories(cove INTERFACE AFTER "${CMAKE_CURRENT_SOURCE_DIR}")
5456
target_link_libraries(cove Qt5::Widgets Qt5::Concurrent)
5557

5658
add_subdirectory("tests")

3rd-party/cove/potrace/copyright

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
Upstream-Name: potrace
3+
Source: http://potrace.sourceforge.net/
4+
5+
Files: *
6+
Copyright: 2001-2005 Peter Selinger <[email protected]>
7+
License: GPL-2+
8+
9+
Files: copyright
10+
Copyright: 2003-2018 Bartosz Fenski <[email protected]>
11+
License: GPL-2+
12+
13+
License: GPL-2+
14+
This package is free software; you can redistribute it and/or modify
15+
it under the terms of the GNU General Public License as published by
16+
the Free Software Foundation; either version 2 of the License, or
17+
(at your option) any later version.
18+
.
19+
This package is distributed in the hope that it will be useful,
20+
but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22+
GNU General Public License for more details.
23+
.
24+
You should have received a copy of the GNU General Public License
25+
along with this program. If not, see <http://www.gnu.org/licenses/>
26+
.
27+
On Debian systems, the complete text of the GNU General
28+
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
29+

CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,12 @@ option(Mapper_BUILD_CLIPPER "Build the Clipper package from source" OFF)
6868

6969
option(Mapper_USE_GDAL "Use the GDAL library" ON)
7070

71-
option(Mapper_WITH_COVE "Build and include contour line vectorization" ON)
7271
if(ANDROID)
73-
set(Mapper_WITH_COVE OFF)
72+
set(Mapper_WITH_COVE_DEFAULT OFF)
73+
else()
74+
set(Mapper_WITH_COVE_DEFAULT ON)
7475
endif()
76+
option(Mapper_WITH_COVE "Build and include contour line vectorization" ${Mapper_WITH_COVE_DEFAULT})
7577

7678
if(CMAKE_BUILD_TYPE MATCHES Release|MinSizeRel|RelWithDebInfo)
7779
set(Mapper_DEVELOPMENT_BUILD_DEFAULT OFF)
@@ -258,8 +260,8 @@ add_subdirectory("symbol sets")
258260
add_subdirectory("translations")
259261
add_subdirectory("3rd-party/qbezier")
260262
if(Mapper_WITH_COVE)
263+
add_feature_info(Mapper_WITH_COVE "${Mapper_WITH_COVE}" "Contour line vectorization")
261264
add_subdirectory("3rd-party/cove")
262-
add_definitions(-DWITH_COVE)
263265
endif()
264266
if(NOT ANDROID)
265267
add_subdirectory("3rd-party/qtsingleapplication")

doc/licensing/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ endif()
111111
if(Mapper_PACKAGE_ASSISTANT)
112112
list(APPEND third_party_components qttools)
113113
endif()
114+
if(TARGET cove)
115+
list(APPEND third_party_components potrace)
116+
endif()
114117

115118
message(STATUS "Direct third-party components: ${third_party_components}")
116119

@@ -131,6 +134,11 @@ set(explicit_copyright_qtsingleapplication
131134
"${PROJECT_SOURCE_DIR}/3rd-party/qtsingleapplication/copyright"
132135
"3rd-party"
133136
)
137+
set(explicit_copyright_potrace
138+
"potrace-1.6.txt"
139+
"${PROJECT_SOURCE_DIR}/3rd-party/cove/potrace/copyright"
140+
"3rd-party"
141+
)
134142
if(Mapper_BUILD_CLIPPER)
135143
set(explicit_copyright_libpolyclipping
136144
"libpolyclipping-${CLIPPER_VERSION}.txt"

src/CMakeLists.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ execute_process(
3535
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
3636
)
3737
include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
38-
if(Mapper_WITH_COVE)
39-
include_directories(AFTER "../3rd-party/cove")
40-
endif()
4138
include_directories(AFTER "../3rd-party/qbezier/src") # Always, last
4239

4340
set(Mapper_Common_SRCS
@@ -268,10 +265,8 @@ target_link_libraries(Mapper_Common
268265
PROJ4::proj
269266
Qt5::Widgets
270267
)
271-
if(Mapper_WITH_COVE)
272-
target_link_libraries(Mapper_Common cove)
273-
endif()
274268
foreach(lib
269+
cove
275270
mapper-gdal
276271
mapper-sensors
277272
printsupport

0 commit comments

Comments
 (0)