我试图为glBinding生成一个MinGW Makefile。但是,在尝试为我的平台配置(Windows / GCC)时,CMake会输出以下错误:
Configuring for platform Windows/GCC.
CMake Error at CMakeFiles/git-data/grabRef.cmake:36 (file):
file failed to open for reading (No such file or directory):
C:/Users/Admin/Desktop/glbinding-master/CMakeFiles/git-data/head-ref
Call Stack (most recent call first):
cmake/GetGitRevisionDescription.cmake:83 (include)
cmake/GitRevision.cmake:14 (get_git_head_revision)
CMakeLists.txt:172 (create_revision_file)
帮助将不胜感激,谢谢!
答案 0 :(得分:0)
有问题的行是(cmake / GetGitRevisionDescription.cmake:69-83):
set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
if(NOT EXISTS "${GIT_DATA}")
file(MAKE_DIRECTORY "${GIT_DATA}")
endif()
if(NOT EXISTS "${GIT_DIR}/HEAD")
return()
endif()
set(HEAD_FILE "${GIT_DATA}/HEAD")
configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY)
configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in"
"${GIT_DATA}/grabRef.cmake"
@ONLY)
include("${GIT_DATA}/grabRef.cmake")
在第一行中定义了一个目录,用于放置临时脚本。随着git修订提取脚本的继续,应该创建临时脚本(configure_file("${_gitdescmoddir}/
GetGitRevisionDescription.cmake.in" ${GIT_DATA}/grabRef.cmake" @ONLY)
)但在最后一行中,目录或文件没有正确创建。
在遇到此问题后,您能否在构建目录中提供有关cmake版本以及目录和grabRef.cmake文件的更多信息?