File: install_android_package.cmake.in

package info (click to toggle)
openorienteering-mapper 0.9.6-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 67,132 kB
  • sloc: cpp: 114,710; ansic: 1,455; sh: 430; java: 240; xml: 140; sed: 64; makefile: 28
file content (80 lines) | stat: -rw-r--r-- 2,816 bytes parent folder | download | duplicates (5)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#
#    Copyright 2019-2020 Kai Pastor
#    
#    This file is part of OpenOrienteering.
# 
#    OpenOrienteering is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
# 
#    OpenOrienteering is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
# 
#    You should have received a copy of the GNU General Public License
#    along with OpenOrienteering.  If not, see <http://www.gnu.org/licenses/>.


# Configure the given input file, and install the result to the output dir.
# The optional third argument may specify an alternative destination filename.
function(configure_and_install in_file out_dir)
	if(ARGN)
		set(filename "${ARGN}")
	else()
		get_filename_component(filename "${in_file}" NAME)
	endif()
	set(tmp_file "@MAPPER_PRO_DIR@/tmp/${filename}")
	# Configure first, so that install can properly detect unchanged files.
	configure_file("${in_file}" "${tmp_file}" @ONLY)
	# Regular install, for regular diagnostic output
	file(INSTALL "${tmp_file}" DESTINATION "${out_dir}")
endfunction()


set(ANDROID_PACKAGE_SOURCE_DIR "@ANDROID_PACKAGE_SOURCE_DIR@")
file(INSTALL "@MAPPER_PRO_DIR@/AndroidManifest.xml" DESTINATION "${ANDROID_PACKAGE_SOURCE_DIR}")
file(INSTALL "@MAPPER_PRO_DIR@/tmp/strings.xml" DESTINATION "${ANDROID_PACKAGE_SOURCE_DIR}/res/values")

set(MAPPER_APP_ID "@MAPPER_APP_ID@")
set(Mapper_VERSION "@Mapper_VERSION@")
foreach(file @INPUT_FILES@)
	if("${file}" MATCHES "java/(org/openorienteering/mapper/.*.java)")
		configure_and_install("@INPUT_SOURCE_DIR@/${file}" "${ANDROID_PACKAGE_SOURCE_DIR}/src/org/openorienteering/mapper" "${CMAKE_MATCH_1}")
	endif()
endforeach()

set(icons
  drawable-ldpi   36
  drawable-mdpi   48
  drawable-hdpi   72
  drawable-xhdpi  96
)
while(icons)
	list(GET icons 0 drawable)
	list(GET icons 1 size)
	file(INSTALL
	  DESTINATION "${ANDROID_PACKAGE_SOURCE_DIR}/res/${drawable}"
	  TYPE FILE
	  FILES "@PROJECT_SOURCE_DIR@/images/mapper-icon/Mapper-${size}.png"
	  RENAME "icon.png"
	)
	list(REMOVE_AT icons 0 1)
endwhile()

$<$<VERSION_LESS:@Qt5Core_VERSION@,5.15.0>:
# Copy the Mapper runtime from the CMake project to the qmake project.
# androiddeployqt uses this location.
file(INSTALL
  DESTINATION "@MAPPER_PRO_DIR@"
  FILES "$<TARGET_FILE:Mapper>"
  )
>

# Copy the Mapper runtime from the CMake project to the packaging dir.
# androiddeployqt checks this location.
file(INSTALL
  DESTINATION "@MAPPER_PRO_DIR@/android-build/libs/@ANDROID_ABI@"
  FILES "$<TARGET_FILE:Mapper>"
)