CMake无法编译测试程序,因为源目录不存在

时间:2013-06-24 12:45:28

标签: cmake

所有。我正在尝试使用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文件夹中的只读属性并禁用了防病毒功能,但仍无效。

1 个答案:

答案 0 :(得分:0)

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