init project

This commit is contained in:
an-tao 2018-04-27 14:38:27 +08:00
parent e3f56d75aa
commit 81ef7d0392
4 changed files with 36 additions and 10 deletions

42
CMakeLists.txt Executable file → Normal file
View File

@ -1,16 +1,38 @@
cmake_minimum_required (VERSION 2.6)
EXEC_PROGRAM(gcc ARGS "--version | grep "^gcc"|awk '{print $3}' | sed s'/)//g'" OUTPUT_VARIABLE version)
MESSAGE(STATUS "This is gcc version:: " ${version})
project (DROGON)
project (DROGON C CXX)
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()
#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()
add_subdirectory(trantor)
SET(CMAKE_INSTALL_PREFIX /usr/local/drogon)
#INSTALL(FILES trantor.cfg DESTINATION conf)
#include_directories(${PROJECT_SOURCE_DIR}/src/base/codec ${PROJECT_SOURCE_DIR}/src/Terminus ${CMAKE_BINARY_DIR}/src/base/protobuf_message)
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()
target_link_libraries(drogon trantor)
#crypt dl m pqxx pq hiredis mongocxx bsoncxx jsoncpp ${LIBCONFIG})
INSTALL(TARGETS drogon DESTINATION bin)

0
LICENSE Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

4
drogon/src/main.cc Executable file
View File

@ -0,0 +1,4 @@
int main()
{
return 0;
}