10 Star 27 Fork 11

Windoze/fibio

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CMakeLists.txt 2.12 KB
一键复制 编辑 原始数据 按行查看 历史
Chen Xu 提交于 2015-09-11 17:35 . MySQL Connector/C++ wrapper
cmake_minimum_required(VERSION 2.8)
project(fibio)
option(WITH_REDIS "Build Redis library" ON)
option(WITH_HTTP "Build HTTP library" ON)
option(WITH_MYSQL "Build MySQL library" ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -ftemplate-depth=256")
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations -Wno-deprecated-register -Wno-macro-redefined")
set(CMAKE_LINK_FLAGS "${CMAKE_LINK_FLAGS} -stdlib=libc++")
endif(APPLE)
find_package(Threads REQUIRED)
find_package(Boost 1.56.0 COMPONENTS system coroutine context thread REQUIRED)
find_package(OpenSSL REQUIRED)
IF((CMAKE_BUILD_TYPE MATCHES Debug) OR (NOT CMAKE_BUILD_TYPE))
add_definitions(-DHAVE_VALGRIND_H)
ENDIF((CMAKE_BUILD_TYPE MATCHES Debug) OR (NOT CMAKE_BUILD_TYPE))
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR})
set(FIBIO_DEPS)
list(APPEND FIBIO_DEPS fibio ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
set(FIBIO_DEPS_INCS)
list(APPEND FIBIO_DEPS_INCS ${Boost_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR})
find_package(ZLIB)
find_package(Boost 1.56.0 COMPONENTS iostreams)
IF(ZLIB_FOUND AND Boost_FOUND)
add_definitions(-DHAVE_ZLIB)
INCLUDE_DIRECTORIES(AFTER ${ZLIB_INCLUDE_DIR})
list(APPEND FIBIO_DEPS ${ZLIB_LIBRARIES})
list(APPEND FIBIO_DEPS ${Boost_LIBRARIES})
list(APPEND FIBIO_DEPS_INCS ${ZLIB_INCLUDE_DIR})
ENDIF(ZLIB_FOUND AND Boost_FOUND)
INCLUDE_DIRECTORIES(AFTER ${CMAKE_SOURCE_DIR}/include)
IF(WIN32)
list(APPEND FIBIO_DEPS wsock32 ws2_32)
ENDIF(WIN32)
IF(WITH_MYSQL)
find_package(MySQLConnectorCPP)
IF(MYSQLCONNECTORCPP_FOUND)
INCLUDE_DIRECTORIES(AFTER ${MYSQLCONNECTORCPP_INCLUDE_DIRS})
list(APPEND FIBIO_DEPS ${MYSQLCONNECTORCPP_LIBRARIES})
list(APPEND FIBIO_DEPS_INCS ${MYSQLCONNECTORCPP_INCLUDE_DIRS})
ELSE(MYSQLCONNECTORCPP_FOUND)
message("MySQL Connector/C++ is not found, disable MySQL support")
ENDIF(MYSQLCONNECTORCPP_FOUND)
ENDIF(WITH_MYSQL)
set(FIBIO_LIBS fibio ${FIBIO_DEPS})
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(test)
ADD_SUBDIRECTORY(example)
INCLUDE("CPackLists.txt")
enable_testing()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/windoze/fibio.git
git@gitee.com:windoze/fibio.git
windoze
fibio
fibio
master

搜索帮助