drogon/CMakeLists.txt

41 lines
1.2 KiB
CMake
Raw Normal View History

2018-04-27 11:00:24 +08:00
cmake_minimum_required (VERSION 2.6)
2018-04-27 14:38:27 +08:00
project (DROGON C CXX)
2018-04-28 14:37:32 +08:00
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fpermissive -g -ggdb")
2018-04-27 14:38:27 +08:00
#EXEC_PROGRAM (gcc ARGS "--version | grep '^gcc'|awk '{print $3}' | sed s'/)//g'" OUTPUT_VARIABLE version)
#MESSAGE(STATUS "This is gcc version:: " ${version})
#if (version LESS 6.0.0)
# MESSAGE(STATUS "old gcc")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fpermissive -g -ggdb")
#else()
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -fpermissive -g -ggdb")
# MESSAGE(STATUS "new gcc")
#endif()
2018-04-27 11:00:24 +08:00
add_subdirectory(trantor)
2018-04-27 14:38:27 +08:00
2018-04-27 11:00:24 +08:00
SET(CMAKE_INSTALL_PREFIX /usr/local/drogon)
#INSTALL(FILES trantor.cfg DESTINATION conf)
2018-04-27 14:38:27 +08:00
2018-04-28 14:37:32 +08:00
include_directories(${PROJECT_SOURCE_DIR}/trantor ${PROJECT_SOURCE_DIR}/drogon/inc)
2018-04-27 14:38:27 +08:00
aux_source_directory(${PROJECT_SOURCE_DIR}/drogon/src DIR_SRCS)
#add_library(db ${DIR_DB_SRCS})
add_executable(drogon ${DIR_SRCS})
add_dependencies(drogon trantor)
#if (version LESS 6.0.0)
# MESSAGE(STATUS "old gcc...")
# set (LIBCONFIG config++)
#else()
# MESSAGE(STATUS "new gcc...")
# set (LIBCONFIG libconfig++)
#endif()
2018-04-28 14:37:32 +08:00
target_link_libraries(drogon trantor pthread)
2018-04-27 14:38:27 +08:00
#crypt dl m pqxx pq hiredis mongocxx bsoncxx jsoncpp ${LIBCONFIG})
INSTALL(TARGETS drogon DESTINATION bin)