cpp_code/CMakeLists.txt

35 lines
878 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版本要求
cmake_minimum_required(VERSION 3.5.1)
# 项目名称
project(glog)
#添加debug信息使得生成的可执行文件可以调试
#set(CMAKE_BUILD_TYPE DEBUG)
#使用通配符添加多个源文件
#file(GLOB SRC_LIST "src/*.c")
#编译选项
add_compile_options(-std=c++11)
# 头文件路径
include_directories("include")
#链接库
# link_libraries(event)
find_package(glog REQUIRED)
# 设置可执行文件的输出目录为 bin 目录
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../bin)
# 生成可执行的文件
# add_executable(bufferevent src/main.cpp src/Circle.cpp)
# 查找当前目录下的所有cpp文件并将其存储到变量中
file(GLOB SOURCES "src/*.cpp")
# 将源文件添加到可执行文件中
add_executable(Circle ${SOURCES})
target_link_libraries(Circle glog)