CMake无法编译测试程序,因为源目录不存在 [英] CMake cannot compile test program as source directory doesnt exist

查看:129
本文介绍了CMake无法编译测试程序,因为源目录不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

all. I'm trying to use cmake for compile some android code with android toolchain on Windows 7x64.

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

when i call cmake as following cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=android.cmake 1>!cmake.log 2>!cmake.error.log

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

I run this command from Administrator console and get following output:

!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 文件夹中的只读属性,并禁用了防病毒功能,但仍然无法使用.

I granted adninistrator rights for cmake.exe itself, cleared read-only attributes from CMakeFiles folder and disabled anti-virus but still not worked.

推荐答案

您似乎遇到了 CMake错误0013131 .此评论建议使用未设置TMP 应该解决问题.重试之前,请不要忘记删除 CMakeCache.txt CMakeFiles 文件夹(或使用源外版本时删除整个构建树).

It looks like you are running into CMake Bug 0013131. This comment suggests that using unset TMP should fix the problem. Don't forget to delete the CMakeCache.txt and CMakeFiles folders (or the entire build tree when using out-of-source builds), before retrying.

这篇关于CMake无法编译测试程序,因为源目录不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆