-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
38 lines (31 loc) · 1.2 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
32
33
34
35
36
37
38
cmake_minimum_required(VERSION 3.5)
project(gravitySimulator)
set(CMAKE_CXX_STANDARD 17)
include(FetchContent)
FetchContent_Declare(SFML
GIT_REPOSITORY https://github.com/SFML/SFML.git
GIT_TAG 2.6.x)
FetchContent_MakeAvailable(SFML)
include_directories(include)
add_executable(gravitySimulator src/main.cpp
include/include.h
include/config.h
include/Object.h
src/GravitySource/GravitySource.h
src/GravitySource/GravitySource.cpp
src/Particle/Particle.h
src/Particle/Particle.cpp
src/Scene/Scene.cpp
src/Scene/Scene.h
)
target_link_libraries(gravitySimulator PRIVATE sfml-graphics)
target_compile_features(gravitySimulator PRIVATE cxx_std_17)
if (WIN32 AND BUILD_SHARED_LIBS)
add_custom_command(TARGET gravitySimulator POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
$<TARGET_RUNTIME_DLLS:gravitySimulator> $<TARGET_FILE_DIR:gravitySimulator> COMMAND_EXPAND_LISTS)
endif()
add_custom_command(TARGET gravitySimulator POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/res $<TARGET_FILE_DIR:gravitySimulator>/res COMMAND_EXPAND_LISTS)
install(TARGETS gravitySimulator)