Eclipse 使用工具链文件在Windows中创建CMake android NDK项目
我试图从Windows机器上运行CMake,生成一个带有特定工具链文件的Android NDK项目。谷歌提供了一个关于如何使用CMake生成Android项目的教程。无论如何,我需要一个Eclipse项目,因为这是将其导入ADT包的唯一方法。现在,在CMake UI上有更多选项:Eclipse 使用工具链文件在Windows中创建CMake android NDK项目,eclipse,android-ndk,cmake,Eclipse,Android Ndk,Cmake,我试图从Windows机器上运行CMake,生成一个带有特定工具链文件的Android NDK项目。谷歌提供了一个关于如何使用CMake生成Android项目的教程。无论如何,我需要一个Eclipse项目,因为这是将其导入ADT包的唯一方法。现在,在CMake UI上有更多选项: 日食CDT4-MinGW eclipsecdt4-NMake eclipsecdt4-Unix 日食CDT4-忍者 第二个(Eclipse CDT-NMake)是此配置的正确选择,当我启动CMake时,它将失败并引发以
CMake Warning at CMakeLists.txt:3 (project):
To use the NMake generator, cmake must be run from a shell that can use the
compiler cl from the command line. This environment does not contain
INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
work.
有什么想法吗?您需要使用vcsvarsall.bat(随Visual Studio提供)初始化环境 例如,对于Microsoft Visual Studio 2010-在要执行cmake命令的同一控制台实例中运行此
“C:\Program Files(x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat”
:
...>"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"
Setting environment for using Microsoft Visual Studio 2010 x86 tools.
或者在“开始”菜单中找到“Visual Studio命令提示符(2010)”(“VS20XX的开发人员命令提示符”适用于最新版本的VS),它为您执行此初始化并在那里运行cmake