我最初让clion工作得非常好并且愚蠢地认为将编译器从msvc
切换到cygwin
是个好主意,但现在glfw
不起作用。从我能够分辨出来的是它即使我在Windows上也认为它在Mac上。请注意,我从未将项目移动或使用到mac(或整个CLion),并且此错误在移回cygwin
之后。编译器看起来很好,但glfw
包似乎是现在搞砸了的。
Cmake输出
C:\Users\Matt\.CLion2017.1\system\cygwin_cmake\bin\cmake.exe -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /cygdrive/c/Users/Matt/CLionProjects/SkyGames
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE
-- Could NOT find Vulkan (missing: VULKAN_LIBRARY VULKAN_INCLUDE_DIR)
-- Using X11 for window creation
CMake Error at /cygdrive/c/Users/Matt/.CLion2017.1/system/cygwin_cmake/share/cmake-3.7.1/Modules/FindX11.cmake:429 (message):
Could not find X11
Call Stack (most recent call first):
Externals/GLFW3/CMakeLists.txt:212 (find_package)
-- Configuring incomplete, errors occurred!
See also "/cygdrive/c/Users/Matt/CLionProjects/SkyGames/cmake-build-debug/CMakeFiles/CMakeOutput.log".
的CMakeLists.txt
cmake_minimum_required(VERSION 3.7)
project(SkyGames)
set(CMAKE_CXX_STANDARD 14)
set(SOURCE_FILES main.cpp Engine/Window.cpp Engine/Window.h Engine/Helpers/functor.h Engine/Engine.cpp Engine/Engine.h Engine/Interfaces/NonCopyable.h Engine/Interfaces/Singleton.h Engine/Interfaces/Manager.h Engine/Observer/Subject.h Engine/Observer/EventListener.cpp Engine/Observer/EventListener.h Engine/Math/EngineMath.cpp Engine/Math/EngineMath.h)
add_executable(SkyGames ${SOURCE_FILES})
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
add_subdirectory(${PROJECT_SOURCE_DIR}/Externals/GLFW3)
find_package(OpenGL REQUIRED)
include_directories(SkyGames ${GLFW_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR})
target_link_libraries(SkyGames glw)
target_link_libraries(SkyGames ${GLFW_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
我对CLion很新,所以我可能会遗漏一些明显的东西。