Finish project setup
This commit is contained in:
@@ -3,5 +3,27 @@ project(AdventOfCode2025)
|
|||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
|
|
||||||
#### Exe to make sure cmake is working
|
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)
|
add_executable(testcmake src/testcmake/main.cpp)
|
||||||
|
|||||||
0
input/.empty
Normal file
0
input/.empty
Normal file
@@ -1,16 +1,6 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
// TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
|
|
||||||
int main() {
|
int main() {
|
||||||
// TIP Press <shortcut actionId="RenameElement"/> when your caret is at the <b>lang</b> variable name to see how CLion can help you rename it.
|
std::cout << "Compiles!" << std::endl;
|
||||||
auto lang = "C++";
|
|
||||||
std::cout << "Hello and welcome to " << lang << "!\n";
|
|
||||||
|
|
||||||
for (int i = 1; i <= 5; i++) {
|
|
||||||
// TIP Press <shortcut actionId="Debug"/> to start debugging your code. We have set one <icon src="AllIcons.Debugger.Db_set_breakpoint"/> breakpoint for you, but you can always add more by pressing <shortcut actionId="ToggleLineBreakpoint"/>.
|
|
||||||
std::cout << "i = " << i << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
// TIP See CLion help at <a href="https://www.jetbrains.com/help/clion/">jetbrains.com/help/clion/</a>. Also, you can try interactive lessons for CLion by selecting 'Help | Learn IDE Features' from the main menu.
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user