-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
31 lines (22 loc) · 1.01 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
cmake_minimum_required (VERSION 3.8)
project(connected-bezier-curves)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
find_package(SFML 2 COMPONENTS system window graphics REQUIRED)
set(NUM_SEGMENTS 50 CACHE STRING "Number of curve segments")
add_definitions(-DNUM_SEGMENTS=${NUM_SEGMENTS})
include_directories(${SFML_INCLUDE_DIR})
aux_source_directory(src sources)
list(REMOVE_ITEM sources "src/Test.cpp")
add_executable(main ${sources})
set_target_properties(main PROPERTIES CXX_STANDARD 17)
target_link_libraries(main ${SFML_LIBRARIES})
target_compile_options(main PUBLIC -Wall -Wextra -Wconversion -pedantic)
option(BUILD_TESTS "Build unit tests with catch")
if(BUILD_TESTS)
aux_source_directory(src test_sources)
list(REMOVE_ITEM test_sources "src/Main.cpp")
add_executable(tests ${test_sources})
set_target_properties(tests PROPERTIES CXX_STANDARD 17)
target_link_libraries(tests ${SFML_LIBRARIES})
target_compile_options(tests PUBLIC -Wall -Wextra -Wconversion -pedantic)
endif()