rms/CMakeLists.txt
2020-07-07 06:40:50 +02:00

40 lines
1,012 B
CMake

cmake_minimum_required(VERSION 3.17)
project(rms)
set(CMAKE_BUILD_TYPE Debug)
# GLFW (window system)
find_package(glfw3 3.3 REQUIRED)
link_libraries(glfw)
# GLEW (OpenglGL dependecies manager)
find_package(GLEW REQUIRED)
include_directories(${GLEW_INCLUDE_DIRS})
link_libraries(${GLEW_LIBRARIES})
# OpenGL
find_package(OpenGL REQUIRED)
include_directories( ${OPENGL_INCLUDE_DIRS})
link_libraries(${OPENGL_LIBRARIES})
# GLM for mathematics
find_package(glm 0.9 REQUIRED)
include_directories( ${GLM_INCLUDE_DIRS})
# Source files
file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS src/*.cpp src/*.hpp)
file(GLOB_RECURSE RESOURCES_SRC_FILES CONFIGURE_DEPENDS resources/*)
# Build
include_directories(${CMAKE_SOURCE_DIR}/src/)
add_executable(rms ${SRC_FILES})
# Resources
add_custom_target(resources
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/resources ${CMAKE_BINARY_DIR}/resources
SOURCES ${RESOURCES_SRC_FILES})
# Build shaders each time we build rms
add_dependencies(rms resources)