1 Star 0 Fork 345

Khail / swoole

forked from winting / swoole 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
CMakeLists.txt 1.72 KB
一键复制 编辑 原始数据 按行查看 历史
韩天峰 提交于 2013-12-05 13:34 . 增加定时器
PROJECT(server)
SET(SWOOLE_VERSION 1.5.5)
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
SET(CMAKE_BUILD_TYPE Debug)
file(GLOB_RECURSE SRC_LIST FOLLOW_SYMLINKS src/*.c)
file(GLOB_RECURSE HEAD_FILES FOLLOW_SYMLINKS include/*.h)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
#message(STATUS "source=${SRC_LIST}")
#message(STATUS "header=${HEAD_FILES}")
add_definitions(-DHAVE_EPOLL -DHAVE_EVENTFD -DHAVE_TIMERFD -DHAVE_CPU_AFFINITY)
INCLUDE_DIRECTORIES(BEFORE ./include ./)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
#libary
add_library(swoole_shared SHARED ${SRC_LIST})
add_library(swoole_static STATIC ${SRC_LIST})
set_target_properties(swoole_shared PROPERTIES OUTPUT_NAME "swoole" VERSION ${SWOOLE_VERSION})
set_target_properties(swoole_static PROPERTIES OUTPUT_NAME "swoole" VERSION ${SWOOLE_VERSION})
target_link_libraries(swoole_shared pthread rt)
target_link_libraries(swoole_static pthread rt)
LINK_DIRECTORIES(${LIBRARY_OUTPUT_PATH})
#test_server
set(TEST_SRC_LIST examples/test_server.c)
add_executable(test_server ${TEST_SRC_LIST};${SRC_LIST})
target_link_libraries(test_server pthread rt)
#unittest
file(GLOB_RECURSE UNITTEST_SRC_LIST FOLLOW_SYMLINKS tests/*.c)
add_executable(unittest ${UNITTEST_SRC_LIST};${SRC_LIST})
target_link_libraries(unittest pthread rt)
#add_dependencies(test_server swoole_static swoole_shared)
#TARGET_LINK_LIBRARIES(test_server swoole)
#install
INSTALL(CODE "MESSAGE(\"Are you run command using root user?\")")
INSTALL(TARGETS swoole_shared swoole_static LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
INSTALL(FILES ${HEAD_FILES} DESTINATION include/swoole)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/swoole_config.h DESTINATION include/swoole)
1
https://gitee.com/Khail/swoole.git
git@gitee.com:Khail/swoole.git
Khail
swoole
swoole
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891