35 lines
912 B
CMake
35 lines
912 B
CMake
cmake_minimum_required(VERSION 4.0)
|
|
project(AdventOfCode2025)
|
|
|
|
set(CMAKE_CXX_STANDARD 23)
|
|
|
|
set(INPUT_DIR "input")
|
|
|
|
##### SETUP COMPILE COMMANDS #####
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS on)
|
|
endif()
|
|
|
|
# Copy the compile commands to the build/ dir, not entirely sure why, but my particular version of clangd is just ignoring its config file.
|
|
|
|
if(EXISTS "${CMAKE_BINARY_DIR}/compile_commands.json")
|
|
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
FILE(COPY "${CMAKE_BINARY_DIR}/compile_commands.json" DESTINATION "${CMAKE_BINARY_DIR}/../")
|
|
ENDIF()
|
|
ENDIF()
|
|
|
|
### Copy the input files dir to build
|
|
file(COPY ${INPUT_DIR} DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
|
|
|
|
|
|
### EXECUTABLES
|
|
|
|
# Exe to make sure cmake is working
|
|
add_executable(testcmake src/testcmake/main.cpp)
|
|
|
|
### Day 1
|
|
# P1
|
|
add_executable(d1p1 src/day1/p1/main.cpp)
|
|
# P2
|
|
add_executable(d1p2 src/day1/p2/main.cpp) |