BlockGame/CMakeLists.txt

37 lines
1.1 KiB
CMake

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
gl/Camera.cpp gl/Camera.h
bmploader.cpp bmploader.h
gl/Texture.cpp gl/Texture.h)
add_executable(opengltest ${srcs})
target_link_libraries(opengltest ${GLFW3_LIBRARY} ${OPENGL_LIBRARY} )