-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
60 lines (52 loc) · 1.51 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
cmake_minimum_required(VERSION 3.11)
project(AlgoVisualizer VERSION 0.1)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug
CACHE STRING "Choose the type of build, options are: (Debug or Release)")
endif (NOT CMAKE_BUILD_TYPE)
# fetch latest argparse
include(FetchContent)
FetchContent_Declare(
argparse
GIT_REPOSITORY https://github.com/p-ranav/argparse.git
)
FetchContent_Declare(
sfml
GIT_REPOSITORY "https://github.com/SFML/SFML.git"
GIT_TAG 2.6.0
)
FetchContent_MakeAvailable(sfml)
FetchContent_MakeAvailable(argparse)
#find_package(SFML 2.6
# COMPONENTS
# graphics
# window
# system
# audio
# REQUIRED
#)
add_executable(AlgoVisualizer)
target_sources(AlgoVisualizer PRIVATE
src/main.cpp
src/App.cpp
src/Bar.cpp
src/Sorter.cpp
src/Utils.cpp
src/Algorithms/QuickSort.cpp
src/Algorithms/BubbleSort.cpp
src/Algorithms/SortAlgorithm.cpp
src/Algorithms/MergeSort.cpp)
target_include_directories(AlgoVisualizer PRIVATE "${PROJECT_BINARY_DIR}"
"include/"
)
target_link_libraries(AlgoVisualizer PRIVATE sfml-graphics sfml-window sfml-system sfml-audio argparse)
if ( CMAKE_COMPILER_IS_GNUCC )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
endif()
if ( MSVC )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
endif()