modify CMakeLists.txt
This commit is contained in:
parent
cc35b08580
commit
0ac3f59276
|
@ -30,7 +30,10 @@ include_directories(${JSONCPP_INCLUDE_DIRS})
|
||||||
link_directories(${JSONCPP_LIBRARY_DIRS})
|
link_directories(${JSONCPP_LIBRARY_DIRS})
|
||||||
find_package (UUID REQUIRED)
|
find_package (UUID REQUIRED)
|
||||||
|
|
||||||
find_package (OpenSSL REQUIRED)
|
find_package (OpenSSL)
|
||||||
|
if(OpenSSL_FOUND)
|
||||||
|
add_definitions(-DUSE_OPENSSL)
|
||||||
|
endif()
|
||||||
message(STATUS "openssl inc path:" ${OPENSSL_INCLUDE_DIR})
|
message(STATUS "openssl inc path:" ${OPENSSL_INCLUDE_DIR})
|
||||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||||
link_directories(${OPENSSL_SSL_LIBRARY})
|
link_directories(${OPENSSL_SSL_LIBRARY})
|
||||||
|
@ -79,7 +82,7 @@ add_dependencies(drogon makeVersion)
|
||||||
|
|
||||||
get_directory_property(DEFS COMPILE_DEFINITIONS)
|
get_directory_property(DEFS COMPILE_DEFINITIONS)
|
||||||
foreach(loop_var ${DEFS})
|
foreach(loop_var ${DEFS})
|
||||||
message(STATUS "definitions " ${loop_var})
|
#message(STATUS "definitions " ${loop_var})
|
||||||
file(APPEND "./config.h" "-D" ${loop_var} " ")
|
file(APPEND "./config.h" "-D" ${loop_var} " ")
|
||||||
endforeach(loop_var)
|
endforeach(loop_var)
|
||||||
file(APPEND "./config.h" "\";")
|
file(APPEND "./config.h" "\";")
|
||||||
|
|
|
@ -1,6 +1,12 @@
|
||||||
#include "Utilities.h"
|
#include "Utilities.h"
|
||||||
#include <drogon/FileUpload.h>
|
#include <drogon/FileUpload.h>
|
||||||
|
#ifdef USE_OPENSSL
|
||||||
#include <openssl/md5.h>
|
#include <openssl/md5.h>
|
||||||
|
#else
|
||||||
|
namespace drogon{
|
||||||
|
//Implement MD5 function here if OpenSSL lib not found
|
||||||
|
}
|
||||||
|
#endif
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
using namespace drogon;
|
using namespace drogon;
|
||||||
|
|
Loading…
Reference in New Issue