-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
37 lines (30 loc) · 1.03 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
cmake_minimum_required(VERSION 3.0.0)
project(aofc2k22 VERSION 0.1.0)
set(CMAKE_CXX_STANDARD 17)
set(AOFC_UTILS_LIB "library")
# set CMAKE_BUILD_TYPE to Debug or Release
# ----------------------------------------
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
# AoC Days
# --------------
set(DAYS)
foreach(i RANGE 1 8)
list(APPEND DAYS Day${i})
endforeach()
# Helper Library
# ----------------
add_subdirectory(utils)
# For each day, create an executable and copy the input file
# ----------------------------------------------------------
foreach(DAY ${DAYS})
# Convert to lowercase so I don't have to capslock the executable
string(TOLOWER ${DAY} LOWERCASE_DAY)
add_executable(${LOWERCASE_DAY} "${DAY}/main.cpp")
set_target_properties(${LOWERCASE_DAY} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${DAY}
)
target_link_libraries(${LOWERCASE_DAY} PUBLIC ${AOFC_UTILS_LIB})
file(COPY ${DAY}/input.txt DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/${DAY})
endforeach()