drogon/CMakeLists.txt

47 lines
1.3 KiB
CMake
Raw Normal View History

2018-04-27 03:00:24 +00:00
cmake_minimum_required (VERSION 2.6)
2018-04-27 06:38:27 +00:00
project (DROGON CXX)
2018-04-27 06:38:27 +00:00
2018-04-28 06:37:32 +00:00
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fpermissive -g -ggdb")
2018-04-27 06:38:27 +00: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()
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_modules/)
find_package (jsoncpp REQUIRED)
include_directories(${JSONCPP_INCLUDE_DIRS})
link_directories(${JSONCPP_LIBRARY_DIRS})
find_package (UUID)
if(UUID_FOUND)
add_definitions(-DUSE_UUID)
endif()
2018-04-27 03:00:24 +00:00
add_subdirectory(trantor)
2018-04-27 06:38:27 +00:00
include_directories(${PROJECT_SOURCE_DIR}/trantor ${PROJECT_SOURCE_DIR}/lib/inc)
2018-04-27 06:38:27 +00:00
add_subdirectory(examples)
2018-04-27 06:38:27 +00:00
aux_source_directory(${PROJECT_SOURCE_DIR}/lib/src DIR_SRCS)
2018-04-27 06:38:27 +00:00
ADD_LIBRARY(drogon ${DIR_SRCS})
2018-04-27 06:38:27 +00:00
SET(CMAKE_INSTALL_PREFIX /usr/local)
install(TARGETS drogon DESTINATION lib)
file(GLOB trantor_net_headers "${CMAKE_CURRENT_SOURCE_DIR}/lib/inc/*.h")
install(FILES ${trantor_net_headers} DESTINATION include/drogon)
add_dependencies(drogon trantor)
2018-04-27 06:38:27 +00:00
#target_link_libraries(drogon trantor pthread)