-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
77 lines (66 loc) · 2.14 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
cmake_minimum_required(VERSION 3.14)
project(l33t-c C CXX)
enable_testing()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# when working offline, forcibly use cache
# set(FETCHCONTENT_FULLY_DISCONNECTED ON)
set(USE_LOCAL_IGRAPH "Use local deps instead of downloading" OFF)
# Make interface for stb
include(FetchContent)
FetchContent_Declare(
stb
GIT_REPOSITORY https://github.com/nothings/stb.git
GIT_TAG master
)
FetchContent_MakeAvailable(stb)
add_library(stb INTERFACE)
target_include_directories(stb INTERFACE ${stb_SOURCE_DIR})
# Make interface for igraph
if (USE_LOCAL_IGRAPH)
find_package(igraph REQUIRED)
else()
FetchContent_Declare(
igraph
GIT_REPOSITORY https://github.com/igraph/igraph.git
GIT_TAG 0.10.13
)
FetchContent_MakeAvailable(igraph)
add_library(libigraph INTERFACE)
target_link_libraries(libigraph INTERFACE igraph)
endif()
# Add Criterion library for testing
FetchContent_Declare(
criterion
GIT_REPOSITORY https://github.com/Snaipe/Criterion.git
GIT_TAG v2.4.1 # Replace with the desired version/tag
)
FetchContent_MakeAvailable(criterion)
set(CRITERION_CMAKE ${criterion_SOURCE_DIR}/dev/cmake/cmake)
set(CMAKE_MODULE_PATH ${CRITERION_CMAKE} ${CMAKE_MODULE_PATH})
find_package(Criterion REQUIRED)
add_library(criterion INTERFACE)
target_link_libraries(criterion INTERFACE ${CRITERION_LIBRARY})
target_include_directories(criterion INTERFACE ${CRITERION_INCLUDE_DIRS})
# Add strict compiler flags for my code. Won't fix
# upstream dependencies
add_compile_options(-Wall -Wextra -Werror)
add_subdirectory(l33tlib)
# Add existing solutions
add_subdirectory(problems/01)
add_subdirectory(problems/02)
add_subdirectory(problems/03)
add_subdirectory(problems/04)
add_subdirectory(problems/05)
add_subdirectory(problems/06)
add_subdirectory(problems/07)
add_subdirectory(problems/08)
add_subdirectory(problems/09)
add_subdirectory(problems/10)
add_subdirectory(problems/11)
add_subdirectory(problems/12)
add_subdirectory(problems/13)
add_subdirectory(problems/14)
add_subdirectory(problems/15)
add_subdirectory(problems/16)
add_subdirectory(problems/17)
add_subdirectory(problems/18)