1 Star 0 Fork 0

邓鑫林/cpp_framwork

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CMakeLists.txt 3.78 KB
一键复制 编辑 原始数据 按行查看 历史
邓鑫林 提交于 2021-03-21 22:56 . done
cmake_minimum_required(VERSION 3.1)
project(sylar)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(cmake/utils.cmake)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} -rdynamic -O3 -fPIC -ggdb -std=c++11 -Wall -Wno-deprecated -Werror -Wno-unused-function -Wno-builtin-macro-redefined -Wno-deprecated-declarations -Wno-error=unused-result -Werror=return-type")
set(CMAKE_C_FLAGS "$ENV{CXXFLAGS} -rdynamic -O3 -fPIC -ggdb -std=c11 -Wall -Wno-deprecated -Werror -Wno-unused-function -Wno-builtin-macro-redefined -Wno-deprecated-declarations -Wno-error=unused-result -Werror=return-type")
include_directories(/usr/local/include)
set(SRC_DIR ${PROJECT_SOURCE_DIR}/sylar)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
find_package(Boost REQUIRED)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
endif()
find_package(Protobuf)
if(Protobuf_FOUND)
include_directories(${Protobuf_INCLUDE_DIRS})
endif()
find_package(OpenSSL REQUIRED)
if(OPENSSL_FOUND)
include_directories(${OPENSSL_INCLUDE_DIR})
endif()
find_package(ZLIB REQUIRED)
if(ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIR})
endif()
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/thirdpart/yaml-cpp)
#include_directories(${CMAKE_CURRENT_SOURCE_DIR}/thirdpart)
#include_directories(${CMAKE_CURRENT_SOURCE_DIR}/thirdpart/yaml-cpp/include)
ragelmaker(sylar/include/http/http11_parser.rl SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/sylar/src/)
ragelmaker(sylar/include/http/httpclient_parser.rl SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/sylar/src/)
ragelmaker(sylar/include/uri.rl SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/sylar/src/)
AUX_SOURCE_DIRECTORY(${SRC_DIR}/src SOURCE )
add_library(sylar SHARED ${SOURCE})
force_redefine_file_macro_for_sources(sylar) # 定义__FILE__为相对路径
target_include_directories(sylar PUBLIC ${SRC_DIR}/include )
set(LIBS
sylar
Threads::Threads
yaml-cpp
dl
jsoncpp
/usr/local/lib/libjsoncpp.a
${ZLIB_LIBRARIES}
${OPENSSL_LIBRARIES}
${PROTOBUF_LIBRARIES}
# event
hiredis_vip
# mysqlclient_r
zookeeper_mt
sqlite3
tinyxml2
jemalloc
)
sylar_add_executable(testlog "./tests/logTest.cc" sylar "${LIBS}")
sylar_add_executable(testconfig "./tests/configTest.cc" sylar "${LIBS}")
sylar_add_executable(logconfigTest "tests/logconfigTest.cc" sylar "${LIBS}")
sylar_add_executable(threadTest "./tests/threadTest.cc" sylar "${LIBS}")
sylar_add_executable(utilTest "./tests/utilTest.cc" sylar "${LIBS}")
sylar_add_executable(fiberTest "./tests/fiberTest.cc" sylar "${LIBS}")
sylar_add_executable(schedulerTest "./tests/schedulerTest.cc" sylar "${LIBS}")
sylar_add_executable(iomanagerTest "./tests/iomanagerTest.cc" sylar "${LIBS}")
sylar_add_executable(timerTest "./tests/timerTest.cc" sylar "${LIBS}")
sylar_add_executable(hookTest "./tests/hookTest.cc" sylar "${LIBS}")
sylar_add_executable(addressTest "./tests/addressTest.cc" sylar "${LIBS}")
sylar_add_executable(socketTest "./tests/socketTest.cc" sylar "${LIBS}")
sylar_add_executable(bytearrayTest "./tests/bytearrayTest.cc" sylar "${LIBS}")
sylar_add_executable(httpTest "./tests/httpTest.cc" sylar "${LIBS}")
sylar_add_executable(httpParseTest "./tests/httpParserTest.cc" sylar "${LIBS}")
sylar_add_executable(tcpServerTest "./tests/tcp_tcp_test.cc" sylar "${LIBS}")
sylar_add_executable(echo_server_example "./examples/echo_server.cc" sylar "${LIBS}")
sylar_add_executable(http_server_test "./tests/http_server_test.cc" sylar "${LIBS}")
sylar_add_executable(http_connection_test "./tests/http_connection_test.cc" sylar "${LIBS}")
sylar_add_executable(uri_test "./tests/uri_test.cc" sylar "${LIBS}")
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/deng_xin_lin/cpp_framwork.git
[email protected]:deng_xin_lin/cpp_framwork.git
deng_xin_lin
cpp_framwork
cpp_framwork
master

搜索帮助