-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
24 lines (20 loc) · 896 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
cmake_minimum_required(VERSION 3.22)
project(boids CXX)
include(FetchContent)
FetchContent_Declare(SFML GIT_REPOSITORY https://github.com/SFML/SFML.git)
FetchContent_MakeAvailable(SFML)
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
add_compile_options(-Werror -Wall -Wextra -Wpedantic -Wshadow -Wconversion -Wsign-conversion -Wold-style-cast)
elseif(MSVC)
add_compile_options(/WX /W4 /permissive-)
endif()
add_executable(boids src/main.cpp src/Boid.cpp)
target_link_libraries(boids PRIVATE SFML::Graphics)
target_compile_definitions(boids PRIVATE FONT_PATH="${CMAKE_SOURCE_DIR}/data")
add_custom_target(format
COMMAND clang-format -i `git ls-files *.hpp *.cpp`
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_custom_target(tidy
COMMAND run-clang-tidy -p ${CMAKE_BINARY_DIR} `git ls-files *.cpp`
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
add_custom_target(run COMMAND boids)