only build https if openssl found, test msvc14 compiler
This commit is contained in:
parent
ec55495562
commit
7960973793
1 changed files with 8 additions and 13 deletions
|
|
@ -10,11 +10,15 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.3)
|
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.3)
|
||||||
message(FATAL_ERROR "Clang version >=3.3 required.")
|
message(FATAL_ERROR "Clang version >=3.3 required.")
|
||||||
endif()
|
endif()
|
||||||
|
elseif (MSVC14)
|
||||||
else()
|
else()
|
||||||
message(WARNING "Your compiler (${CMAKE_CXX_COMPILER_ID}) has not been tested on this project. Only Clang and GCC has been tested. Please report any problems at the project page on GitHub.")
|
message(WARNING "Your compiler (${CMAKE_CXX_COMPILER_ID}) has not been tested on this project. Only Clang and GCC has been tested. Please report any problems at the project page on GitHub.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
OPTION(ENABLE_SSL "Use ssl" ON)
|
|
||||||
|
include_directories(.)
|
||||||
|
|
||||||
|
find_package(Threads REQUIRED)
|
||||||
|
|
||||||
set(Boost_USE_STATIC_LIBS ON)
|
set(Boost_USE_STATIC_LIBS ON)
|
||||||
set(Boost_USE_MULTITHREADED ON)
|
set(Boost_USE_MULTITHREADED ON)
|
||||||
|
|
@ -27,21 +31,12 @@ if(APPLE)
|
||||||
set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl")
|
set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
#TODO: add requirement for version 1.0.1g (can it be done in one line?)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
|
find_package(OpenSSL QUIET)
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_SSL)
|
if(OpenSSL_FOUND)
|
||||||
#TODO: add requirement for version 1.0.1g (can it be done in one line?)
|
|
||||||
find_package(OpenSSL REQUIRED)
|
|
||||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||||
endif()
|
|
||||||
|
|
||||||
find_package(Threads REQUIRED)
|
|
||||||
|
|
||||||
include_directories(.)
|
|
||||||
|
|
||||||
if(ENABLE_SSL)
|
|
||||||
add_executable(https_examples https_examples.cpp)
|
add_executable(https_examples https_examples.cpp)
|
||||||
target_link_libraries(https_examples ${Boost_LIBRARIES})
|
target_link_libraries(https_examples ${Boost_LIBRARIES})
|
||||||
target_link_libraries(https_examples ${OPENSSL_LIBRARIES})
|
target_link_libraries(https_examples ${OPENSSL_LIBRARIES})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue