代码拉取完成,页面将自动刷新
cmake_minimum_required(VERSION 2.4)
#project name
set(PROJECTNAME test-anet)
#output path
set(OUTPUT ./bin/)
project(${PROJECTNAME})
set(CMAKE_C_COMPILER gcc)
set(CMAKE_CXX_COMPILER g++)
#include directories
include_directories(
./
../pipe
../anet
../anet/asio
../anet/prometh
../anet/timer
../anet/log
../anet/pool
../kcp
)
#library.
SET(LIBRARIES
-lpthread
)
#link directories
link_directories(
)
#definition flag
add_definitions(
-std=c++17
-g
-O3
#-Wno-unused-variable
-Wall
#-Wno-deprecated
)
#output path
set(EXECUTABLE_OUTPUT_PATH ${OUTPUT})
#project src files
file(GLOB SRC_FILES "*.cpp" "*.hpp" "*.h" "*.c" "*.cc")
aux_source_directory(../anet ANET_FILES)
aux_source_directory(../anet/timer TIMER_SRC)
aux_source_directory(../anet/log LOG_SRC)
aux_source_directory(../pipe PIPE_SRC)
aux_source_directory(../kcp KCP_SRC)
#merge src files to SRC.
set(SRC
${SRC_FILES}
${TIMER_SRC}
${LOG_SRC}
${ANET_FILES}
${PIPE_SRC}
${KCP_SRC}
)
#executable
add_executable(
${PROJECTNAME}
${SRC}
)
#link libraries
target_link_libraries(${PROJECTNAME} ${LIBRARIES})
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。