mirror of
https://github.com/CodePanda66/CSPostgraduate-408.git
synced 2023-05-21 21:49:33 +08:00
14 lines
570 B
CMake
14 lines
570 B
CMake
cmake_minimum_required(VERSION 3.15)
|
||
project(2021_CSKaoYan_408)
|
||
|
||
set(CMAKE_CXX_STANDARD 14)
|
||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||
|
||
# 遍历项目根目录下所有的 .cpp 文件
|
||
# 排除掉leetcode 下的代码,其不需要在Clion 中编译运行!
|
||
file (GLOB_RECURSE files ./*.cpp ./*/*.cpp ./*/*/*.cpp ./*/*/*/*.cpp)
|
||
foreach (file ${files})
|
||
string(REGEX REPLACE ".+/(.+)\\..*" "\\1" exe ${file})
|
||
add_executable (${exe} ${file})
|
||
message (\ \ \ \ --\ src/${exe}.cpp\ will\ be\ compiled\ to\ bin/${exe})
|
||
endforeach () |