如何在Clion中编写Opengl程序
cmake_minimum_required(VERSION 3.13)
project(learnopengl)
set(CMAKE_CXX_STANDARD 17)
add_executable(learnopengl main.cpp src/glad.c)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include)
link_directories(${PROJECT_SOURCE_DIR}/lib)
target_link_libraries(learnopengl ${PROJECT_SOURCE_DIR}/dll/glfw3.dll)
PS:其中learnopengl为工程名字,请自行修改。
- 把dll放入exe运行目录
- 编译运行