cmake无法打开文件

时间:2014-03-26 17:18:09

标签: makefile cmake cygwin

使用cmake编译一个简单的项目时,我得到了

    $ cmake CMakeLists.txt
    CMake Error: cmListFileCache: error can not open file /cygdrive/d/Balladen/helloWorld/CMakeFiles/CMakeSystem.cmake
    -- The C compiler identification is GNU 4.8.2
    CMake Error: cmListFileCache: error can not open file /cygdrive/d/Balladen/helloWorld/CMakeFiles/CMakeCCompiler.cmake
    CMake Error: Could not find cmake module file:/cygdrive/d/Balladen/helloWorld/CMakeFiles/CMakeCCompiler.cmake
    -- The CXX compiler identification is GNU 4.8.2
    CMake Error: cmListFileCache: error can not open file /cygdrive/d/Balladen/helloWorld/CMakeFiles/CMakeCXXCompiler.cmake
    CMake Error: Could not find cmake module file:/cygdrive/d/Balladen/helloWorld/CMakeFiles/CMakeCXXCompiler.cmake
    CMake Error: cmListFileCache: error can not open file /cygdrive/d/Balladen/helloWorld/CMakeFiles/CMakeSystem.cmake
    CMake Error: cmListFileCache: error can not open file /cygdrive/d/Balladen/helloWorld/CMakeFiles/CMakeRCCompiler.cmake
    CMake Error: Could not find cmake module file:/cygdrive/d/Balladen/helloWorld/CMakeFiles/CMakeRCCompiler.cmake

的CMakeLists.txt:

    cmake_minimum_required(VERSION 2.8.4)
    project('helloWorld')

    ## Target
    set(TEST_SRCS main.cpp)
    add_executable(helloWorld ${TEST_SRCS})

    ## Link libraries
    target_link_libraries(helloWorld ${CMAKE_THREAD_LIBS_INIT})

文件CMakeCCompiler和CMakeCXXCompiler不存在,文件CMakeSystem.cmake没有访问权限。因此无法阅读。

    $ ls -la *
    -rw-r--r--+ 1 WUD Domain Users 10195 Mar 26 17:59 CMakeCache.txt
    ----------+ 1 WUD Domain Users   426 Mar 26 17:53 CMakeLists.txt
    ----------+ 1 WUD Domain Users    64 Mar 26 17:58 main.cpp
    ----------+ 1 WUD Domain Users  5667 Mar 26 17:34 Makefile

    CMakeFiles:
    total 16
    drwxr-xr-x+ 1 WUD Domain Users   0 Mar 26 17:59 .
    d---------+ 1 WUD Domain Users   0 Mar 26 17:59 ..
    -rw-r--r--  1 WUD Domain Users  85 Mar 26 17:59 cmake.check_cache
    -rw-r--r--  1 WUD Domain Users  72 Mar 26 17:59 CMakeError.log
    -rw-r--r--  1 WUD Domain Users 803 Mar 26 17:59 CMakeOutput.log
    ----------  1 WUD Domain Users 221 Mar 26 17:59 CMakeRCCompiler.cmake
    ----------  1 WUD Domain Users 402 Mar 26 17:59 CMakeSystem.cmake
    drwxr-xr-x+ 1 WUD Domain Users   0 Mar 26 17:59 CMakeTmp
    drwxr-xr-x+ 1 WUD Domain Users   0 Mar 26 17:59 CompilerIdC
    drwxr-xr-x+ 1 WUD Domain Users   0 Mar 26 17:59 CompilerIdCXX

如果我从其他项目复制文件并为CMakeFiles中的所有文件添加阅读权限,那么它可以正常工作。我有几个项目的这个问题。在已安装的驱动器上运行它有帮助(例如在真正的加密驱动器上)。 所以我猜测访问权限的问题。 我在互联网上找到的所有提示都没有帮助。 我正在使用Windows 7,Cygwin 32位,cmake版本2.8.9

有什么想法吗?

0 个答案:

没有答案