-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
85 lines (72 loc) · 2.25 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
78
79
80
81
82
83
84
85
cmake_minimum_required(VERSION 3.1)
set(CMAKE_VERBOSE_MAKEFILE ON)
if(aoc2021_VERBOSE)
message(STATUS "Configuring...")
endif()
project(aoc2021 VERSION 1.0.0)
add_executable(aoc2021 src/main.cpp)
target_sources(aoc2021 PRIVATE
src/utils.cpp
src/utils.h
src/day01.cpp
src/day02.cpp
src/day03.cpp
src/day04.cpp
src/day05.cpp
src/day06.cpp
src/day07.cpp
src/day08.cpp
src/day09.cpp
src/day10.cpp
src/day11.cpp
src/day12.cpp
src/day13.cpp
src/day14.cpp
src/day15.cpp
src/day16.cpp
src/day17.cpp
src/day18.cpp
src/day19.cpp
src/day20.cpp
src/day21.cpp
src/day22.cpp
src/day23.cpp
src/day24.cpp
src/day25.cpp
)
set(CMAKE_C_COMPILER "gcc-12")
set(CMAKE_CXX_COMPILER "/usr/bin/g++-12")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -std=c++20 -fcoroutines -pthread")
set(aoc2021_VERSION_STRING "1.0.0")
set(aoc2021_DESCRIPTION "Advent of Code 2021 using C++")
set(aoc2021_VERSION_REGEX "^([0-9]+)\\.([0-9]+)\\.([0-9]+)([-]rc[-]|\\.)?([0-9]*)$")
string(REGEX REPLACE "${aoc2021_VERSION_REGEX}" "\\1"
aoc2021_VERSION_MAJOR "${aoc2021_VERSION_STRING}")
string(REGEX REPLACE "${aoc2021_VERSION_REGEX}" "\\2"
aoc2021_VERSION_MINOR "${aoc2021_VERSION_STRING}")
string(REGEX REPLACE "${aoc2021_VERSION_REGEX}" "\\3"
aoc2021_VERSION_PATCH "${aoc2021_VERSION_STRING}")
string(REGEX REPLACE "${aoc2021_VERSION_REGEX}" "\\5"
aoc2021_VERSION_PRERELEASE "${aoc2021_VERSION_STRING}")
message(STATUS "${aoc2021_VERSION_PRERELEASE}")
# Package version
set(aoc2021_VERSION
"${aoc2021_VERSION_MAJOR}.${aoc2021_VERSION_MINOR}.${aoc2021_VERSION_PATCH}")
if(aoc2021_VERSION_PRERELEASE)
set(aoc2021_VERSION "${aoc2021_VERSION}.${aoc2021_VERSION_PRERELEASE}")
else()
set(aoc2021_VERSION "${aoc2021_VERSION}.0")
endif()
message(STATUS "${aoc2021_VERSION}")
if(aoc2021_VERBOSE)
message(STATUS "Configuration script parsing status [")
message(STATUS " Description : ${aoc2021_DESCRIPTION}")
message(STATUS " Version : ${aoc2021_VERSION} (${aoc2021_VERSION_STRING})")
message(STATUS "]")
endif()
if(aoc2021_VERBOSE)
message(STATUS "Configuring done")
endif(aoc2021_VERBOSE)