主要是CMakeLists.txt文件变化
cmake_minimum_required(VERSION 3.10)
project(glfwTest)
set(CMAKE_CXX_STANDARD 11)
aux_source_directory(. SRC_SOURCES)
add_executable(glfwTest ${SRC_SOURCES})
target_link_libraries(glfwTest opengl32) # 链接库文件
target_include_directories(glfwTest PUBLIC ./include)
target_link_directories(glfwTest PUBLIC ./lib/glfw)
target_link_libraries(glfwTest glfw3dll.lib )
代码示例cmake使用glfw3.dll资源-CSDN文库
其它事项请参考GLFW入门-CSDN博客https://blog.csdn.net/sq8706/article/details/139183884?spm=1001.2014.3001.5501
注意:测试运行时,需把glfw3.dll文件复制到build目录中。