rms/CMakeLists.txt
2020-07-05 18:55:39 +02:00

41 lines
1 KiB
CMake

cmake_minimum_required(VERSION 3.17)
project(rms)
set(CMAKE_BUILD_TYPE Debug)
# SFML (window system)
find_package(SFML 2.5 COMPONENTS window)
link_libraries(sfml-window)
# 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 SHADERS_SRC_FILES CONFIGURE_DEPENDS resources/shaders/*)
# Build
include_directories(${CMAKE_SOURCE_DIR}/src/)
add_executable(rms ${SRC_FILES})
# Shaders
add_custom_target(shaders
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/resources/shaders ${CMAKE_BINARY_DIR}/resources/shaders
SOURCES ${SHADERS_SRC_FILES})
# Build shaders each time we build rms
add_dependencies(rms shaders)