代码拉取完成,页面将自动刷新
cmake_minimum_required (VERSION 2.6)
project (levin)
file(GLOB LEVIN_LIB_SOURCES "src/*.cpp" "src/details/*.cpp" "src/utils/*.cpp")
file(GLOB LEVIN_LIB_HEADERS "src/*.h" "src/*.hpp" "src/utils/*.h" "src/utils/*.hpp")
file(GLOB LEVIN_LIB_HEADERS_DETAILS "src/details/*.h" "src/details/*.hpp")
set(ROOT ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_CXX_FLAGS "-g -pipe -W -Wall -fPIC -std=c++0x")
set(CMAKE_CXX_FLAGS_DEBUG "-O0")
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
set(PROJECT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
# Thirdparty dependency dir
set(THIRD_PARTY /usr/include/)
set(BOOST_MODULE ${THIRD_PARTY}/boost)
set(BOOST_MODULE_INCLUDE ${BOOST_MODULE}/include)
file(GLOB_RECURSE BOOST_MODULE_LIB "${BOOST_MODULE}/lib/*.a")
message( STATUS "Boost include dir: " ${BOOST_MODULE_INCLUDE})
set(BOOST_ROOT ${BOOST_MODULE_INCLUDE})
find_package(Boost 1.56.0 REQUIRED)
set(GTEST_MODULE ${THIRD_PARTY}/gtest)
set(GTEST_MODULE_INCLUDE ${GTEST_MODULE}/include)
file(GLOB_RECURSE GTEST_MODULE_LIB "${GTEST_MODULE}/lib/*.a")
set(OPENSSL_MODULE ${THIRD_PARTY}/openssl)
set(OPENSSL_MODULE_INCLUDE ${OPENSSL_MODULE}/include)
file(GLOB_RECURSE OPENSSL_MODULE_LIB "${OPENSSL_MODULE}/lib/*.a")
include_directories(
src/
src/details/
src/utils/
${BOOST_MODULE_INCLUDE}
${GTEST_MODULE_INCLUDE}
${OPENSSL_MODULE_INCLUDE})
add_library(levin STATIC ${LEVIN_LIB_SOURCES})
target_link_libraries(levin
${BOOST_MODULE_LIB}
${OPENSSL_MODULE_LIB}
pthread
crypto
ssl
rt)
install(TARGETS levin DESTINATION ${PROJECT_DIR}/output/lib)
install(FILES ${LEVIN_LIB_HEADERS} DESTINATION ${PROJECT_DIR}/output/include)
install(FILES ${LEVIN_LIB_HEADERS_DETAILS} DESTINATION ${PROJECT_DIR}/output/include/details)
add_subdirectory(test)
add_subdirectory(example)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。