-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
32 lines (25 loc) · 939 Bytes
/
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
32
cmake_minimum_required(VERSION 3.24)
# set the project name
project(HelloWorld)
# add the executable
add_executable(HelloWorld main.cpp)
set_property(TARGET HelloWorld PROPERTY CXX_STANDARD 20)
set_property(TARGET HelloWorld PROPERTY CXX_STANDARD_REQUIRED On)
set_property(TARGET HelloWorld PROPERTY CXX_EXTENSIONS Off)
add_subdirectory(contrib/SDL)
add_subdirectory(contrib/bvh)
add_subdirectory(contrib/glm)
# libraries
target_link_libraries(${PROJECT_NAME} PRIVATE SDL2::SDL2 SDL2::SDL2main glm bvh)
# Windows-only configurations
if (WIN32)
# copy the .dll file to the same folder as the executable
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:SDL2::SDL2>
$<TARGET_FILE_DIR:${PROJECT_NAME}>
VERBATIM)
endif()
# copy resources to build directory
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/bluenoise256.png DESTINATION ${CMAKE_CURRENT_BINARY_DIR})