summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cord-Landwehr <[email protected]>2015-09-11 22:27:57 +0200
committerAndreas Cord-Landwehr <[email protected]>2015-09-12 17:54:02 +0200
commit00550be350122aeda444caab8ea521d44ea3999f (patch)
tree9872e63d6a6a2e8f5c5140ef5803adeeeb99c2eb
parent42661ce36adb478e920c5bf3ea594c6ff5c8d722 (diff)
Cleanup Android build and make compatible with ECM.
Change to proper use of CMAKE_SYSTEM_NAME, which is required by the ECM toolchain. After this change, Marble-Maps can be build by the command: cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/ECM/toolchain/Android.cmake \ -DCMAKE_PREFIX_PATH=/path/to/5.5/android_armv7/ \ -DQT_NO_WEBKIT=TRUE -DQT_NO_PRINTER=TRUE -DQT_NO_DBUS=TRUE ../marble REVIEW: 125176
-rw-r--r--CMakeLists.txt34
-rw-r--r--src/apps/CMakeLists.txt2
-rw-r--r--src/apps/marble-maps/CMakeLists.txt6
-rw-r--r--src/apps/marble-maps/package/deploy-marble-maps.json.in8
-rw-r--r--src/lib/astro/CMakeLists.txt4
-rw-r--r--src/lib/marble/CMakeLists.txt4
-rw-r--r--src/plugins/CMakeLists.txt2
7 files changed, 16 insertions, 44 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 570be7f..7c9c665 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,39 +49,11 @@ option(MOBILE "Create a Marble version optimized for handheld devices")
####################################################
# Specific options for building with Qt 4 vs 5
-if(ANDROID)
- if (NOT DEFINED ENV{Qt5_host})
- message(FATAL_ERROR "Configure the env variable Qt5_host to point to your host Qt5 installation.")
- else()
- message(STATUS "Qt5 host installation dir: $ENV{Qt5_host}")
- endif()
-
- if (NOT DEFINED ENV{Qt5_android})
- message(FATAL_ERROR "Configure the env variable Qt5_android to point to your android Qt5 installation.")
- else()
- message(STATUS "Qt5 android installation dir: $ENV{Qt5_android}")
- endif()
-
- if (NOT DEFINED ENV{Qt5_android_cmake})
- message(FATAL_ERROR "Configure the env variable Qt5_android_cmake to point to your qt-android-cmake installation.")
- else()
- message(STATUS "Qt5 android cmake installation dir: $ENV{Qt5_android_cmake}")
- endif()
-
- if(NOT DEFINED ENV{ANDROID_PLATFORM})
- message(FATAL_ERROR "Configure the env variable ANDROID_PLATFORM to specify your target platform (e.g.: android-18).")
- else()
- message(STATUS "Android target platform: $ENV{ANDROID_PLATFORM}")
- endif()
-
+if(CMAKE_SYSTEM_NAME STREQUAL Android)
# Minimum Qt version
set(QT_REQUIRED_VERSION 5.3.0)
SET(QT_QMAKE_EXECUTABLE "$ENV{Qt5_android}/bin/qmake")
- SET(CMAKE_PREFIX_PATH "$ENV{Qt5_android}/lib/cmake")
-
- include_directories(SYSTEM "$ENV{ANDROID_NDK}/platforms/$ENV{ANDROID_PLATFORM}/arch-arm/usr/include")
- message(STATUS "Include directories: " "$ENV{ANDROID_NDK}/platforms/$ENV{ANDROID_PLATFORM}/arch-arm/usr/include")
find_package(Qt5Location)
find_package(Qt5Positioning)
@@ -175,7 +147,7 @@ endif( WIN32 )
####################################################
# Build a D-Bus interface for marble
# This is disabled by default for all win32, apple and Qt-Only builds
-if(WIN32 OR APPLE OR ANDROID)
+if(WIN32 OR APPLE OR CMAKE_SYSTEM_NAME STREQUAL 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)
@@ -228,7 +200,7 @@ elseif(APPLE)
#SET (lib_dir ${CMAKE_INSTALL_PREFIX}/Marble.app/Contents/MacOS/lib)
SET (data_dir ${CMAKE_INSTALL_PREFIX}/Marble.app/Contents/MacOS/resources/data)
SET (plugin_dir ${CMAKE_INSTALL_PREFIX}/Marble.app/Contents/MacOS/resources/plugins)
-elseif(ANDROID)
+elseif(CMAKE_SYSTEM_NAME STREQUAL Android)
set(plugin_dir "${CMAKE_INSTALL_PREFIX}/assets/plugins")
set(data_dir "${CMAKE_INSTALL_PREFIX}/assets/data")
else() # Linux / bsd etc...
diff --git a/src/apps/CMakeLists.txt b/src/apps/CMakeLists.txt
index 5f71ced..a3d2db1 100644
--- a/src/apps/CMakeLists.txt
+++ b/src/apps/CMakeLists.txt
@@ -1,4 +1,4 @@
-if (NOT ANDROID)
+if (NOT CMAKE_SYSTEM_NAME STREQUAL Android)
add_subdirectory(marble-ui)
add_subdirectory(marble-qt)
add_subdirectory(marble-mobile)
diff --git a/src/apps/marble-maps/CMakeLists.txt b/src/apps/marble-maps/CMakeLists.txt
index 670d6cb..ed35539 100644
--- a/src/apps/marble-maps/CMakeLists.txt
+++ b/src/apps/marble-maps/CMakeLists.txt
@@ -3,7 +3,7 @@ qt5_add_resources(marble_QRCS MarbleMaps.qrc)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
-if (ANDROID)
+if (CMAKE_SYSTEM_NAME STREQUAL Android)
set(TARGET Marble)
find_package(Qt5AndroidExtras)
@@ -36,7 +36,7 @@ target_link_libraries (
FILE(GLOB QML_FILES *.qml)
add_custom_target(marble-maps_resources ALL SOURCES ${QML_FILES} package/AndroidManifest.xml)
-if (ANDROID)
+if (CMAKE_SYSTEM_NAME STREQUAL Android)
install(DIRECTORY "../../../data/android/" DESTINATION "${CMAKE_INSTALL_PREFIX}/res")
set(ABSOLUTE_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}")
if(NOT IS_ABSOLUTE "${ABSOLUTE_INSTALL_PATH}")
@@ -55,7 +55,7 @@ if (ANDROID)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/deploy-marble-maps.json DESTINATION "${CMAKE_INSTALL_PREFIX}/share")
install(TARGETS ${TARGET} LIBRARY DESTINATION libs/${ANDROID_ABI})
else()
- if(ANDROID OR MARBLE_INSTALL_ANDROID_APPS)
+ if(CMAKE_SYSTEM_NAME STREQUAL Android OR MARBLE_INSTALL_ANDROID_APPS)
if(APPS_INSTALL_DIR)
install(PROGRAMS org.kde.marble.maps.desktop DESTINATION ${APPS_INSTALL_DIR})
endif(APPS_INSTALL_DIR)
diff --git a/src/apps/marble-maps/package/deploy-marble-maps.json.in b/src/apps/marble-maps/package/deploy-marble-maps.json.in
index 3a28e7d..0f1fb90 100644
--- a/src/apps/marble-maps/package/deploy-marble-maps.json.in
+++ b/src/apps/marble-maps/package/deploy-marble-maps.json.in
@@ -3,10 +3,10 @@
"sdk": "@[email protected]",
"ndk": "@[email protected]",
- "toolchain-prefix": "@[email protected]",
- "tool-prefix": "@[email protected]",
- "toolchain-version": "@[email protected]",
- "ndk-host": "@[email protected]",
+ "toolchain-prefix": "@[email protected]",
+ "tool-prefix": "@[email protected]",
+ "toolchain-version": "@[email protected]",
+ "ndk-host": "@[email protected]",
"target-architecture": "@[email protected]",
"application-binary": "@[email protected]",
"android-package": "@[email protected]",
diff --git a/src/lib/astro/CMakeLists.txt b/src/lib/astro/CMakeLists.txt
index a26a99d..17a59b8 100644
--- a/src/lib/astro/CMakeLists.txt
+++ b/src/lib/astro/CMakeLists.txt
@@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(
${QT_INCLUDE_DIR}
)
-if(NOT ANDROID)
+if(NOT CMAKE_SYSTEM_NAME STREQUAL Android)
SET(GENERIC_LIB_VERSION "0.17.20")
SET(GENERIC_LIB_SOVERSION "1")
endif()
@@ -41,7 +41,7 @@ endif(WIN32)
SET_TARGET_PROPERTIES(astro PROPERTIES
DEFINE_SYMBOL MAKE_ASTRO_LIB # needed for astrolib_export.h
)
-if(NOT ANDROID)
+if(NOT CMAKE_SYSTEM_NAME STREQUAL Android)
SET_TARGET_PROPERTIES(astro PROPERTIES
VERSION ${GENERIC_LIB_VERSION}
SOVERSION ${GENERIC_LIB_SOVERSION}
diff --git a/src/lib/marble/CMakeLists.txt b/src/lib/marble/CMakeLists.txt
index 4c2da41..b3133af 100644
--- a/src/lib/marble/CMakeLists.txt
+++ b/src/lib/marble/CMakeLists.txt
@@ -42,7 +42,7 @@ INCLUDE(graphicsview/CMakeLists.txt)
INCLUDE(layers/CMakeLists.txt)
INCLUDE(osm/CMakeLists.txt)
-if(NOT ANDROID)
+if(NOT CMAKE_SYSTEM_NAME STREQUAL Android)
set(GENERIC_LIB_VERSION "0.21.80")
set(GENERIC_LIB_SOVERSION "22")
endif()
@@ -420,7 +420,7 @@ if(WIN32)
TARGET_LINK_LIBRARIES(${MARBLEWIDGET} ws2_32 imm32 winmm)
endif(WIN32)
-if(NOT ANDROID)
+if(NOT CMAKE_SYSTEM_NAME STREQUAL Android)
set_target_properties(${MARBLEWIDGET} PROPERTIES
VERSION ${GENERIC_LIB_VERSION}
SOVERSION ${GENERIC_LIB_SOVERSION})
diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt
index abb756d..cb5915f 100644
--- a/src/plugins/CMakeLists.txt
+++ b/src/plugins/CMakeLists.txt
@@ -1,4 +1,4 @@
-if(NOT ANDROID)
+if(NOT CMAKE_SYSTEM_NAME STREQUAL Android)
add_subdirectory( designer )
add_subdirectory( templates )
endif()