2022-02-05 20:44:31 +00:00
|
|
|
cmake_minimum_required(VERSION 3.21)
|
|
|
|
project(opengltest)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
|
|
|
|
|
|
|
|
|
|
|
# We need a CMAKE_DIR with some code to find external dependencies
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
|
|
|
|
|
|
|
|
# OpenGL
|
|
|
|
find_package(OpenGL REQUIRED)
|
|
|
|
|
|
|
|
# GLM
|
|
|
|
find_package(GLM REQUIRED)
|
|
|
|
message(STATUS "GLM included at ${GLM_INCLUDE_DIR}")
|
|
|
|
|
|
|
|
# GLFW
|
|
|
|
find_package(GLFW3 REQUIRED)
|
|
|
|
message(STATUS "Found GLFW3 in ${GLFW3_INCLUDE_DIR}")
|
|
|
|
|
|
|
|
SET(srcs main.cpp gl/Shader.cpp gl/Shader.h
|
|
|
|
gl/IndexBuffer.cpp gl/IndexBuffer.h
|
|
|
|
gl/VertexBuffer.cpp gl/VertexBuffer.h
|
|
|
|
gl/VertexArray.cpp gl/VertexArray.h
|
|
|
|
gl/Renderer.cpp gl/Renderer.h
|
|
|
|
blocks/BaseBlock.cpp blocks/BaseBlock.h
|
|
|
|
blocks/GrasBlock.cpp blocks/GrasBlock.h
|
|
|
|
blocks/BlockRenderer.cpp blocks/BlockRenderer.h
|
|
|
|
blocks/RenderBase.cpp blocks/RenderBase.h
|
2022-02-06 13:47:33 +00:00
|
|
|
gl/Camera.cpp gl/Camera.h
|
|
|
|
bmploader.cpp bmploader.h
|
|
|
|
gl/Texture.cpp gl/Texture.h)
|
2022-02-05 20:44:31 +00:00
|
|
|
|
|
|
|
add_executable(opengltest ${srcs})
|
|
|
|
|
|
|
|
target_link_libraries(opengltest ${GLFW3_LIBRARY} ${OPENGL_LIBRARY} )
|