Commit 59bfc956 authored by ivan tkachenko's avatar ivan tkachenko Committed by Alexander Lohnau
Browse files

Simplify cmake condition for Android

In order to do that, cmake_minimum_required had to be slightly updated.
parent b612d1c6
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.7)
# Set minimum OS X target
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9)
......@@ -90,7 +90,7 @@ option(BUILD_TOUCH "Build touch-friendly Marble version (on Android this option
####################################################
# Build a D-Bus interface for the Marble widget
# This is disabled by default for all win32, apple and Android
if(WIN32 OR APPLE OR CMAKE_SYSTEM_NAME STREQUAL Android)
if(WIN32 OR APPLE OR ANDROID)
option(BUILD_WITH_DBUS "Build the D-Bus interface for the Marble widget" OFF)
else()
option(BUILD_WITH_DBUS "Build the D-Bus interface for the Marble widget" ON)
......@@ -100,7 +100,7 @@ endif()
#######################################################
# Specific options for building for different platforms
if(CMAKE_SYSTEM_NAME STREQUAL Android)
if(ANDROID)
add_definitions(-DANDROID)
endif()
......@@ -111,7 +111,7 @@ endif()
find_package(Protobuf)
set_package_properties(Protobuf PROPERTIES TYPE OPTIONAL PURPOSE "Parsing of OSM PBF files.")
if(CMAKE_SYSTEM_NAME STREQUAL Android)
if(ANDROID)
set(REQUIRED_QT_VERSION 5.7.0)
# TODO: still needed with ECM toolchain?
SET(QT_QMAKE_EXECUTABLE "$ENV{Qt5_android}/bin/qmake")
......@@ -133,7 +133,7 @@ find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED
PrintSupport
)
if(CMAKE_SYSTEM_NAME STREQUAL Android)
if(ANDROID)
find_package(Qt5Positioning ${REQUIRED_QT_VERSION} REQUIRED)
find_package(Qt5Multimedia ${REQUIRED_QT_VERSION} REQUIRED)
......@@ -211,7 +211,7 @@ elseif(APPLE)
SET (data_dir ${CMAKE_INSTALL_PREFIX}/Marble.app/Contents/MacOS/resources/data)
set(locale_dir "${data_dir}/locale")
SET (plugin_dir ${CMAKE_INSTALL_PREFIX}/Marble.app/Contents/MacOS/resources/plugins)
elseif(CMAKE_SYSTEM_NAME STREQUAL Android)
elseif(ANDROID)
set(plugin_dir "${CMAKE_INSTALL_PREFIX}/assets/plugins")
set(data_dir "${CMAKE_INSTALL_PREFIX}/assets/data")
set(locale_dir "${data_dir}/locale")
......
......@@ -207,7 +207,7 @@ function(marble_process_po_files_as_qm lang po_file)
set(build_dir ${CMAKE_CURRENT_BINARY_DIR}/locale/${lang})
set(ts_file ${build_dir}/${filename_base}.ts)
set(qm_file ${build_dir}/${filename_base}.qm)
if(CMAKE_SYSTEM_NAME STREQUAL Android)
if(ANDROID)
set(qm_install_dir "${locale_dir}/${lang}")
else()
set(qm_install_dir "${locale_dir}/${lang}/LC_MESSAGES")
......
option(BUILD_MARBLE_APPS "Build the main Marble applications" ON)
if(BUILD_MARBLE_APPS)
if (NOT CMAKE_SYSTEM_NAME STREQUAL Android)
if (NOT ANDROID)
add_subdirectory(marble-ui)
add_subdirectory(marble-qt)
add_subdirectory(marble-kde)
......
......@@ -3,7 +3,7 @@ qt5_add_resources(marble_QRCS MarbleBehaim.qrc)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
if (CMAKE_SYSTEM_NAME STREQUAL Android)
if (ANDROID)
set(TARGET MarbleBehaim)
find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS AndroidExtras)
......@@ -43,7 +43,7 @@ target_link_libraries (
FILE(GLOB QML_FILES *.qml)
add_custom_target(marble-behaim_resources ALL SOURCES ${QML_FILES} package/AndroidManifest.xml)
if (CMAKE_SYSTEM_NAME STREQUAL Android)
if (ANDROID)
install(DIRECTORY "../../../data/android/" DESTINATION "${CMAKE_INSTALL_PREFIX}/res")
set(ABSOLUTE_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}")
if(NOT IS_ABSOLUTE "${ABSOLUTE_INSTALL_PATH}")
......
......@@ -44,7 +44,7 @@ if(WIN32)
TARGET_LINK_LIBRARIES(astro ws2_32 imm32 winmm)
endif(WIN32)
if (NOT (CMAKE_SYSTEM_NAME STREQUAL Android))
if (NOT ANDROID)
set_target_properties(astro PROPERTIES
EXPORT_NAME "Astro"
VERSION ${ASTRO_LIB_VERSION}
......
......@@ -441,7 +441,7 @@ set_target_properties(marblewidget PROPERTIES
COMPILE_FLAGS "-DKML_LAZY_IMP"
)
if (NOT (CMAKE_SYSTEM_NAME STREQUAL Android))
if (NOT ANDROID)
set_target_properties(marblewidget PROPERTIES
VERSION ${MARBLE_LIB_VERSION}
SOVERSION ${MARBLE_LIB_SOVERSION}
......
if(NOT CMAKE_SYSTEM_NAME STREQUAL Android)
if(NOT ANDROID)
add_subdirectory( designer )
add_subdirectory( templates )
endif()
......
......@@ -49,6 +49,6 @@ endif()
find_package( Perl )
marble_set_package_properties( Perl PROPERTIES URL "https://www.perl.org" )
marble_set_package_properties( Perl PROPERTIES TYPE OPTIONAL PURPOSE "generation of sources in the APRS plugin" )
if(PERL_FOUND AND NOT CMAKE_SYSTEM_NAME STREQUAL Android)
if(PERL_FOUND AND NOT ANDROID)
add_subdirectory( aprs )
endif()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment