-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
31 lines (20 loc) · 1.45 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
project(18-reflection VERSION 1.0.2 LANGUAGES CXX)
set(EXECUTABLE_NAME 18-reflection)
set(SOURCES "src/main.cpp" "src/common/AbstractMesh.cpp" "src/common/AbstractSkyboxBuilder.cpp" "src/common/AbstractMeshBuilder.cpp" "src/common/AssimpModel.cpp" "src/common/CubemapSkyboxBuilder.cpp" "src/common/MultimeshModel.cpp" "src/common/SimpleSkyboxBuilder.cpp" "src/common/SingleMeshModel.cpp" "src/common/Skybox.cpp")
add_executable(${EXECUTABLE_NAME} ${SOURCES})
target_include_directories(${EXECUTABLE_NAME} PRIVATE "src")
target_precompile_headers(${EXECUTABLE_NAME} PRIVATE "src/common/stdafx.hpp")
target_compile_features(${EXECUTABLE_NAME} PRIVATE cxx_std_20)
find_package(SFML COMPONENTS system window graphics CONFIG REQUIRED)
target_link_libraries(${EXECUTABLE_NAME} PRIVATE sfml-system sfml-graphics sfml-window)
find_package(globjects CONFIG REQUIRED)
target_link_libraries(${EXECUTABLE_NAME} PRIVATE globjects::globjects)
find_package(glm CONFIG REQUIRED)
target_link_libraries(${EXECUTABLE_NAME} PRIVATE ${GLM_LIBRARIES})
find_package(OpenGL REQUIRED)
target_link_libraries(${EXECUTABLE_NAME} PUBLIC ${OPENGL_LIBRARIES})
find_package(assimp CONFIG REQUIRED)
target_link_libraries(${EXECUTABLE_NAME} PRIVATE assimp::assimp)
# copy media
add_custom_command(TARGET ${EXECUTABLE_NAME} PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_LIST_DIR}/../media $<TARGET_FILE_DIR:${EXECUTABLE_NAME}>/media)