【问题标题】:CMake cannot compile test program as source directory doesnt existCMake 无法编译测试程序,因为源目录不存在
【发布时间】:2013-06-24 12:45:27
【问题描述】:

全部。我正在尝试使用 cmake 在 Windows 7x64 上使用 android 工具链编译一些 android 代码。

当我如下调用 cmake 时 cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=android.cmake 1>!cmake.log 2>!cmake.error.log

我从管理员控制台运行此命令并获得以下输出:

!cmake.log

-- The C compiler identification is GNU 4.6.0
-- The CXX compiler identification is GNU 4.6.0
-- Check for working C compiler: c:/cygwin/usr/local/android-toolchain-r8ea9/bin/arm-linux-androideabi-gcc.exe
-- Check for working C compiler: c:/cygwin/usr/local/android-toolchain-r8ea9/bin/arm-linux-androideabi-gcc.exe -- broken
-- Configuring incomplete, errors occurred!

!cmake.error.log

CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler
  "c:/cygwin/usr/local/android-toolchain-r8ea9/bin/arm-linux-androideabi-gcc.exe"
  is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/PDK_BUILD/openssl/CMakeFiles/CMakeTmp



  Run Build Command:C:/PROGRA~2/CMAKE2~1.8/bin/cmake.exe
  "cmTryCompileExec333575975/fast"

  CMake Error: The source directory
  "C:/PDK_BUILD/openssl/CMakeFiles/CMakeTmp/cmTryCompileExec333575975/fast"
  does not exist.


  Specify --help for usage, or press the help button on the CMake GUI.






  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):

我授予了 cmake.exe 本身的管理员权限,从 CMakeFiles 文件夹中清除了只读属性并禁用了防病毒但仍然无效。

【问题讨论】:

    标签: cmake


    【解决方案1】:

    您似乎遇到了CMake Bug 0013131This comment suggests 使用 unset TMP 应该可以解决问题。在重试之前,不要忘记删除 CMakeCache.txtCMakeFiles 文件夹(或使用外源构建时的整个构建树)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-18
      • 1970-01-01
      • 2015-08-13
      • 1970-01-01
      • 2023-03-31
      • 2023-04-08
      • 2019-09-02
      • 1970-01-01
      相关资源
      最近更新 更多