modify CMakeLists.txt

This commit is contained in:
an-tao 2018-06-26 14:52:41 +08:00
parent 80542e42c2
commit 3391584d9f
2 changed files with 14 additions and 4 deletions

View File

@ -6,7 +6,7 @@ project (DROGON CXX)
EXEC_PROGRAM (gcc ARGS "--version | grep '^gcc'|awk '{print $3}' | sed s'/)//g' | sed s'/-.*//g'" OUTPUT_VARIABLE version) EXEC_PROGRAM (gcc ARGS "--version | grep '^gcc'|awk '{print $3}' | sed s'/)//g' | sed s'/-.*//g'" OUTPUT_VARIABLE version)
MESSAGE(STATUS "This is gcc version:: " ${version}) MESSAGE(STATUS "This is gcc version:: " ${version})
if(version LESS 4.9.0) if(version LESS 4.8.5)
MESSAGE(STATUS "gcc is too old") MESSAGE(STATUS "gcc is too old")
stop() stop()
elseif (version LESS 6.1.0) elseif (version LESS 6.1.0)
@ -25,10 +25,20 @@ endif()
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_modules/) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_modules/)
#jsoncpp
find_package (Jsoncpp REQUIRED) find_package (Jsoncpp REQUIRED)
include_directories(${JSONCPP_INCLUDE_DIRS}) include_directories(${JSONCPP_INCLUDE_DIRS})
link_directories(${JSONCPP_LIBRARY_DIRS}) #message(STATUS ${JSONCPP_LIBRARIES})
if(NOT EXISTS ${JSONCPP_INCLUDE_DIRS}/json/version.h)
message(STATUS "jsoncpp lib is too old.....stop")
stop()
endif()
EXEC_PROGRAM(cat ARGS "${JSONCPP_INCLUDE_DIRS}/json/version.h |grep JSONCPP_VERSION_STRING|sed s'/.*define/define/'|awk '{printf $3}'|sed s'/\"//g'" OUTPUT_VARIABLE jsoncpp_ver)
message(STATUS "jsoncpp verson:" ${jsoncpp_ver})
if(jsoncpp_ver LESS 1.8)
MESSAGE(STATUS "jsoncpp lib is too old,please get new version from https://github.com/open-source-parsers/jsoncpp")
stop()
endif()
find_package (UUID REQUIRED) find_package (UUID REQUIRED)
find_package (OpenSSL) find_package (OpenSSL)

@ -1 +1 @@
Subproject commit 6c401f8f83b94d60c2dca60e481cab1a786485e4 Subproject commit c667355d3703ef0595804e3fd9d412f7fba631fd