Browse Source

CMake: UseAndroid can be included as an oneliner.

pull/403/head
Vladimír Vondruš 7 years ago
parent
commit
a180be551b
  1. 3
      CMakeLists.txt
  2. 12
      doc/platforms-android.dox

3
CMakeLists.txt

@ -200,8 +200,7 @@ if(BUILD_TESTS)
# that has builtin Android support -- Gradle uses 3.6 so this will nicely # that has builtin Android support -- Gradle uses 3.6 so this will nicely
# work in both cases. # work in both cases.
if(CORRADE_TARGET_ANDROID AND CMAKE_ANDROID_NDK) if(CORRADE_TARGET_ANDROID AND CMAKE_ANDROID_NDK)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/toolchains/modules/") include(${PROJECT_SOURCE_DIR}/toolchains/modules/UseAndroid.cmake)
include(UseAndroid)
endif() endif()
endif() endif()

12
doc/platforms-android.dox

@ -215,16 +215,14 @@ Gradle.
used for the final release builds. used for the final release builds.
Download contents of the toolchains repository from https://github.com/mosra/toolchains Download contents of the toolchains repository from https://github.com/mosra/toolchains
or add it as a Git submodule, add its module path to `CMAKE_MODULE_PATH` and or add it as a Git submodule and include the `UseAndroid` module from there.
include the `UseAndroid` module. Wrapping it in a check for presence of Wrapping it in a check for presence of `CMAKE_ANDROID_NDK` will make it
`CMAKE_ANDROID_NDK` will make it possible to have the pure CMake and a Gradle possible to have the pure CMake and a Gradle build coexist --- because Gradle
build coexist --- because Gradle internally uses CMake 3.6 which doesn't know internally uses CMake 3.6 which doesn't know about `CMAKE_ANDROID_NDK` yet.
about `CMAKE_ANDROID_NDK` yet.
@code{.cmake} @code{.cmake}
if(CORRADE_TARGET_ANDROID AND CMAKE_ANDROID_NDK) if(CORRADE_TARGET_ANDROID AND CMAKE_ANDROID_NDK)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/toolchains/modules/") include(${PROJECT_SOURCE_DIR}/toolchains/modules/UseAndroid.cmake)
include(UseAndroid)
endif() endif()
@endcode @endcode

Loading…
Cancel
Save