# 设置CMAKE 的最低要求版本 cmake_minimum_required(VERSION 3.25) # 设置c++版本要求 set(CMAKE_CXX_STANDARD 11) # 强制指定,不允许编译器降级 set(CMAKE_CXX_STANDARD_REQUIRED ON) # 关闭编译器扩展功能 set(CMAKE_CXX_EXTENSIONS OFF) # 项目名称 project(cpp_start LANGUAGES CXX VERSION 1.0.0) # 设置编译器参数 set(CMAKE_CXX_FLAGS "-fno-elide-constructors") # 关闭编译优化 # 消息提示 message(STATUS "message from cmake file!") # 添加用于生成可执行文件 add_executable(${PROJECT_NAME} src/main.cpp) aux_source_directory(src/aspect ASPECT_DIR) aux_source_directory(src/base BASE_DIR) aux_source_directory(src/util UTIL_DIR) aux_source_directory(src/test TEST_DIR) target_include_directories(${PROJECT_NAME} PRIVATE ) target_sources(${PROJECT_NAME} PRIVATE ${ASPECT_DIR} ${TEST_DIR} ${BASE_DIR} ${UTIL_DIR} )