2
# This module finds if the required Android/Java tools are installed and
3
# determines their paths. This code sets the following variables:
5
# ANDROID_TOOL = the full path to the android executable (Android SDK)
6
# ANT_TOOL = the full path to the ant executable (JDK)
7
# JARSIGNER_TOOL = the full path to the jarsigner executable (JDK)
8
# ZIPALIGN_TOOL = the full path to the zipalign tool (Android SDK)
9
# ANT_TOOL_FLAGS = flags passed to the ant executable
10
# JARSIGNER_TOOL_FLAGS = flags passed to the jarsigner executable
11
# ZIPALIGN_TOOL_FLAGS = flags passed to the zipalign executable
13
#=============================================================================
14
# DrMIPS - Educational MIPS simulator
15
# Copyright (C) 2014 Bruno Nova <ei08109@fe.up.pt>
17
# This program is free software: you can redistribute it and/or modify
18
# it under the terms of the GNU General Public License as published by
19
# the Free Software Foundation, either version 3 of the License, or
20
# (at your option) any later version.
22
# This program is distributed in the hope that it will be useful,
23
# but WITHOUT ANY WARRANTY; without even the implied warranty of
24
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
# GNU General Public License for more details.
27
# You should have received a copy of the GNU General Public License
28
# along with this program. If not, see <http://www.gnu.org/licenses/>.
29
#=============================================================================
31
mark_as_advanced(ANDROID_TOOL ANT_TOOL JARSIGNER_TOOL ZIPALIGN_TOOL
32
ANT_TOOL_FLAGS JARSIGNER_TOOL_FLAGS ZIPALIGN_TOOL_FLAGS)
35
find_program(ANDROID_TOOL android)
36
find_program(ANT_TOOL ant)
37
find_program(JARSIGNER_TOOL jarsigner)
38
find_program(ZIPALIGN_TOOL zipalign)
40
# Define the default flags for the tools
41
set(ANT_TOOL_FLAGS "-q" CACHE STRING "Flags passed to ant.")
42
separate_arguments(ANT_TOOL_FLAGS)
43
set(JARSIGNER_TOOL_FLAGS "-sigalg SHA1withRSA -digestalg SHA1" CACHE STRING "Flags passed to jarsigner.")
44
separate_arguments(JARSIGNER_TOOL_FLAGS)
45
set(ZIPALIGN_TOOL_FLAGS "-f 4" CACHE STRING "Flags passed to zipalign.")
46
separate_arguments(ZIPALIGN_TOOL_FLAGS)
49
find_package_handle_standard_args(Android "Could not find all the required Android tools!\nBoth JDK and Android SDK must be installed, and the SDK's tools/ directory must be in the PATH."
50
ANDROID_TOOL ANT_TOOL JARSIGNER_TOOL ZIPALIGN_TOOL)