summaryrefslogtreecommitdiff
path: root/graphics/openorienteering-mapper/files/patch-CMakeLists.txt
blob: 3dd0be8fb86d48cd298209dafb8935423e31abb9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
--- CMakeLists.txt.orig	2020-04-04 15:19:17 UTC
+++ CMakeLists.txt
@@ -66,6 +66,11 @@ option(Mapper_DEBUG_TRANSLATIONS "Debug missing transl
 # Used for some Linux distributions which do not provide the polyclipping lib.
 option(Mapper_BUILD_CLIPPER "Build the Clipper package from source" OFF)
 
+option(Mapper_WITH_DOCS "Build and/or install documentation" ON)
+option(Mapper_WITH_EXAMPLES "Build and/or install examples" ON)
+option(Mapper_WITH_NLS "Native Language Support" ON)
+option(Mapper_WITH_TEST "Build the test suite" ON)
+
 option(Mapper_USE_GDAL   "Use the GDAL library" ON)
 
 if(ANDROID)
@@ -260,10 +265,20 @@ endif()
 
 # Subdirectories
 
+if (Mapper_WITH_DOCS)
 add_subdirectory("doc/manual")
+endif()
+if (Mapper_WITH_EXAMPLES)
 add_subdirectory("examples")
+endif()
 add_subdirectory("symbol sets")
-add_subdirectory("translations")
+if (Mapper_WITH_NLS)
+       add_subdirectory("translations")
+else()
+       execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "packaging/linux")
+       execute_process(COMMAND "${CMAKE_COMMAND}" -E copy "${PROJECT_SOURCE_DIR}/packaging/linux/Mapper.desktop" "packaging/linux/")
+       execute_process(COMMAND "${CMAKE_COMMAND}" -E copy "${PROJECT_SOURCE_DIR}/packaging/linux/openorienteering-mapper.xml" "packaging/linux/")
+endif()
 if(Mapper_WITH_COVE)
 	add_feature_info(Mapper_WITH_COVE "${Mapper_WITH_COVE}" "Contour line vectorization")
 	add_subdirectory("3rd-party/cove")
@@ -287,7 +302,7 @@ if(CMAKE_CROSSCOMPILING)
 	add_custom_target(TEST_WARNING ALL
 	  COMMENT "Crosscompiling, skipping all tests")
 	add_dependencies(TEST_WARNING Mapper)
-else()
+elseif(Mapper_WITH_TEST)
 	enable_testing()
 	add_subdirectory("test")
 endif()