-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
41 lines (35 loc) · 1022 Bytes
/
CMakeLists.txt
File metadata and controls
41 lines (35 loc) · 1022 Bytes
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
39
40
41
cmake_minimum_required(VERSION 3.14)
project(BoidsSimulation)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Fetch SFML from GitHub
include(FetchContent)
FetchContent_Declare(
sfml
GIT_REPOSITORY https://github.com/SFML/SFML.git
GIT_TAG 2.6.x
)
set(SFML_BUILD_AUDIO FALSE)
set(SFML_BUILD_NETWORK FALSE)
FetchContent_MakeAvailable(sfml)
find_package(TBB REQUIRED)
# Add Source files from the src directory
add_executable(Boids
src/main.cpp
src/boid.cpp
src/quadtree.cpp
)
# Include the headers from the include directory
target_include_directories(Boids PRIVATE include)
# Link SFML
target_link_libraries(Boids PRIVATE sfml-graphics sfml-window sfml-system TBB::tbb)
# Windows: Copy DLLs to the build folder
if(WIN32)
add_custom_command(TARGET Boids POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:sfml-graphics>
$<TARGET_FILE:sfml-window>
$<TARGET_FILE:sfml-system>
$<TARGET_FILE_DIR:Boids>
)
endif()