Files
CSPostgraduate-408/CMakeLists.txt
2021-08-22 00:50:03 +08:00

14 lines
570 B
CMake
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 ()