update
This commit is contained in:
parent
3dc9994ca2
commit
9f0cfa2bbd
27
2024/11/CMakeLists.txt
Normal file
27
2024/11/CMakeLists.txt
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.10)
|
||||||
|
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
add_compile_options(-Wall)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
|
|
||||||
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
|
set(CMAKE_BUILD_TYPE Debug)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message("Build type is [${CMAKE_BUILD_TYPE}]")
|
||||||
|
|
||||||
|
|
||||||
|
project(algorithm_2024)
|
||||||
|
|
||||||
|
include_directories(${CMAKE_CURRENT_LIST_DIR}/src/include)
|
||||||
|
|
||||||
|
file(GLOB_RECURSE SRC_LIST CONFIGURE_DEPENDS ${CMAKE_CURRENT_LIST_DIR}/src/*.cpp)
|
||||||
|
|
||||||
|
foreach(SRC IN LISTS SRC_LIST)
|
||||||
|
get_filename_component(SRC_NAME_WE ${SRC} NAME_WE)
|
||||||
|
message("[${SRC}] will be build to [${SRC_NAME_WE}]")
|
||||||
|
add_executable(${SRC_NAME_WE} ${SRC})
|
||||||
|
endforeach()
|
4
2024/11/src/HelloWorld/helloworld.cpp
Normal file
4
2024/11/src/HelloWorld/helloworld.cpp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#include <iostream>
|
||||||
|
int main(){
|
||||||
|
std::cout<<"Hello world"<<'\n';
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user