[cmake-developers] Android variables

Ruslan Baratov ruslan_baratov at yahoo.com
Fri Nov 11 08:28:46 EST 2016


On 11-Nov-16 21:09, Brad King wrote:
> On 11/10/2016 10:46 PM, Ruslan Baratov wrote:
>> the value "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}cpp${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}"
> This expression is the documented way to get the paths to the Android tools.
> I see no reason to add a pre-evaluated copy for every tool.
Reason is the same as with CMAKE_GDBSERVER variable. Instead of forcing
users to redefine (probably with different names) this variable each
time we can do it once in CMake.

>
>> ANDROID_TOOLCHAIN_MACHINE_NAME?
> In your original message it looked like you needed this only to construct
> the path above.
Nope, this one needed too.

>
>> get_filename_component(ANDROID_TOOLCHAIN_MACHINE_NAME "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}" NAME)
>> string(REGEX REPLACE "-$" "" ANDROID_TOOLCHAIN_MACHINE_NAME "${ANDROID_TOOLCHAIN_MACHINE_NAME}")
> AFAICT the only meaning this value has is exactly what that code expresses.
>
> What is your use case for getting this value and why is it needed separately?
Even if they may not be needed in regular CMake code such variables can
be useful "outside". Autotools based projects use
ANDROID_TOOLCHAIN_MACHINE_NAME variable: `./configure
--host=${ANDROID_TOOLCHAIN_MACHINE_NAME}`. Preprocessor is required too:
`CPP=${CMAKE_C_PREPROCESSOR} ./configure`. Variables
ANDROID_NDK_HOST_SYSTEM_NAME and ANDROID_COMPILER_VERSION is used in
tool `androiddeployqt` which do build Qt application for Android.

Ruslo

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20161111/aa9c28b2/attachment.html>


More information about the cmake-developers mailing list