rms/CMakeLists.txt

41 lines
1,012 B
Text
Raw Permalink Normal View History

2020-07-05 18:55:39 +02:00
cmake_minimum_required(VERSION 3.17)
project(rms)
set(CMAKE_BUILD_TYPE Debug)
2020-07-07 06:40:50 +02:00
# GLFW (window system)
find_package(glfw3 3.3 REQUIRED)
link_libraries(glfw)
2020-07-05 18:55:39 +02:00
# 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)
2020-07-07 06:40:50 +02:00
file(GLOB_RECURSE RESOURCES_SRC_FILES CONFIGURE_DEPENDS resources/*)
2020-07-05 18:55:39 +02:00
# Build
include_directories(${CMAKE_SOURCE_DIR}/src/)
add_executable(rms ${SRC_FILES})
2020-07-07 06:40:50 +02:00
# Resources
add_custom_target(resources
2020-07-05 18:55:39 +02:00
COMMAND ${CMAKE_COMMAND} -E copy_directory
2020-07-07 06:40:50 +02:00
${CMAKE_SOURCE_DIR}/resources ${CMAKE_BINARY_DIR}/resources
SOURCES ${RESOURCES_SRC_FILES})
2020-07-05 18:55:39 +02:00
# Build shaders each time we build rms
2020-07-07 06:40:50 +02:00
add_dependencies(rms resources)
2020-07-05 18:55:39 +02:00