【问题标题】:CMake android NDK project in Windows with toolchain file带有工具链文件的 Windows 中的 CMake android NDK 项目
【发布时间】:2014-08-14 16:22:50
【问题描述】:

我正在尝试从 Windows 机器运行 CMake 以生成具有特定工具链文件的 Android NDK 项目。谷歌有一个关于如何使用 CMake 生成 Android 项目的教程。无论如何,我需要该项目是一个 Eclipse 项目,因为这是将其导入 ADT 包的唯一方法。现在在 CMake UI 上有更多选项:

  1. Eclipse CDT4 - MinGW
  2. Eclipse CDT4 - NMake
  3. Eclipse CDT4 - Unix
  4. Eclipse 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.

有什么想法吗?

【问题讨论】:

    标签: eclipse android-ndk cmake


    【解决方案1】:

    您需要使用 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)”(最新版本的 VS 为“VS20XX 的开发人员命令提示符”),它会为您执行此初始化并在那里运行 cmake。

    【讨论】:

      猜你喜欢
      • 2021-02-06
      • 2019-01-28
      • 2017-06-17
      • 1970-01-01
      • 1970-01-01
      • 2018-09-17
      • 1970-01-01
      • 2019-06-06
      • 2018-09-17
      相关资源
      最近更新 更多