[CMake] CMake targeting Android with "Visual Studio 15 2017" generator issue

Bruce Elliott belliott at kuttatech.com
Fri Nov 3 12:26:52 EDT 2017


We are trying to port a C++/OpenGL project from MS Windows to Android. The
project is using CMake to generate solution and project files for Visual
Studio 2017. All attempts to create solution and project files for VS2017
when targeting Android have failed with the CMake GUI generating the
following error message:

>CMake Error at CMakeLists.txt:100 (project):
>  CMAKE_SYSTEM_NAME is 'Android' but 'NVIDIA Nsight Tegra Visual Studio
>  Edition' is not installed.
>
>Configuring incomplete, errors occurred!
>See also
"C:/SVN/Nexus_Android/Build_Android_vs2017/CMakeFiles/CMakeOutput.log".

Line 100 of the CMakeLists.txt is: 
    "project(${PROJECT_NAME} C CXX)"

The log file contains:
   The target system is: Android - 23 - 
   The host system is: Windows - 10.0.16299 - AMD64

I have tried toolchain files from OpenCV, Taka-No-Me as well as a simple
toolchain file as follows:

set(CMAKE_SYSTEM_NAME Android)
set(CMAKE_SYSTEM_VERSION 23) # API level
set(CMAKE_ANDROID_API 23)
set(CMAKE_ANDROID_API_MIN 16)
set(CMAKE_ANDROID_NDK C:/ProgramData/Microsoft/AndroidNDK/android-ndk-r15c)
set(CMAKE_ANDROID_ARCH arm64-v8a)
set(CMAKE_ANDROID_ARCH_ABI arm64-v8a)

All result in the CMake GUI generating the error above.

I have created a Native-Activity Application(Android) test project in VS2017
and have been able to build/deploy/debug the native C++ on both emulated
targets for Android and a USB connected Android tablet target. VS2017 does
not require ''NVIDIA Nsight Tegra Visual Studio Edition'. Is there a work
around for CMake to get it to generate native C++ Android projects for
VS2017?

Tool versions being used:
Visual Studio 15 2017
CMake 3.10.0-rc3
Android NDK  r15c


Regards,
Bruce Elliott



More information about the CMake mailing list