我尝试从https://github.com/glfw/glfw.git克隆源代码后为glfw生成配置。我只在Windows上出错(在ubuntu linux上我没有问题)。我怀疑我的CMake有问题,但我不确定。
当我从glfw的根目录运行CMake时,我使用Cmake 2.8获得以下错误
C:\temp\glfw-master>cmake .
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Using Win32 for window creation
-- Using WGL for context creation
CMake Error at examples/CMakeLists.txt:16 (include_directories):
include_directories given empty-string as include directory.
-- Configuring incomplete, errors occurred!
然后我尝试升级到CMake最新3.0.1,我仍然得到错误,但有更多信息:
$ cmake .
-- Building for: Visual Studio 11 2012
-- The C compiler identification is MSVC 17.0.61030.0
-- Check for working C compiler using: Visual Studio 11 2012
-- Check for working C compiler using: Visual Studio 11 2012 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Found OpenGL: opengl32
-- Looking for include file pthread.h
-- Looking for include file pthread.h - not found
-- Found Threads: TRUE
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Using Win32 for window creation
-- Using WGL for context creation
CMake Error at examples/CMakeLists.txt:16 (include_directories):
include_directories given empty-string as include directory.
-- Configuring incomplete, errors occurred!
See also "C:/temp/glfw/CMakeFiles/CMakeOutput.log".
See also "C:/temp/glfw/CMakeFiles/CMakeError.log".
如果我检查CMakeError.log
它似乎提到缺少pthreads(这对我来说没有意义,因为这是windows,可能pthreads.h
只能在基于posix的操作系统上使用)
CheckIncludeFiles.c
CheckIncludeFiles.c(2): fatal error C1083: Cannot open include file: 'pthread.h'
: No such file or directory [C:\temp\glfw\CMakeFiles\CMakeTmp\cmTryCompileExec38
59330081.vcxproj]
Done Building Project "C:\temp\glfw\CMakeFiles\CMakeTmp\cmTryCompileExec38593300
81.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\temp\glfw\CMakeFiles\CMakeTmp\cmTryCompileExec3859330081.vcxproj" (default t
arget) (1) ->
(ClCompile target) ->
CheckIncludeFiles.c(2): fatal error C1083: Cannot open include file: 'pthread.
h': No such file or directory [C:\temp\glfw\CMakeFiles\CMakeTmp\cmTryCompileExec
3859330081.vcxproj]
0 Warning(s)
1 Error(s)
任何人都可以了解我可能错过的内容吗?我尝试在glfw irc和讨论论坛上发布这个问题,但我认为它不是很活跃,而且我还在努力让这个问题得以实现。也可能是我没有在那里得到答案,因为它与CMake和我的配置更相关,而不是glfw本身。
谢谢!