Now supports MSYS2, and parse_test compile with g++-5.2.

This commit is contained in:
U-ole-PC\ole 2015-09-29 15:19:59 +02:00
commit 9a708dc7a0
3 changed files with 14 additions and 11 deletions

View file

@ -16,35 +16,33 @@ endif()
#Only tested with versions 1.55 and 1.56
find_package(Boost 1.54.0 COMPONENTS regex system thread coroutine context filesystem REQUIRED)
message("Boost include dir: ${Boost_INCLUDE_DIR}")
message("Boost libraries: ${Boost_LIBRARIES}")
include_directories(${Boost_INCLUDE_DIR})
if(APPLE)
set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl")
set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl")
endif()
#TODO: add requirement for version 1.0.1g (can it be done in one line?)
find_package(OpenSSL REQUIRED)
message("OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}")
message("OpenSSL SSL libraries: ${OPENSSL_SSL_LIBRARIES}")
message("OpenSSL crypto libraries: ${OPENSSL_CRYPTO_LIBRARIES}")
include_directories(${OPENSSL_INCLUDE_DIR})
find_package(Threads REQUIRED)
message("Threads libraries/flag: ${CMAKE_THREAD_LIBS_INIT}")
include_directories(.)
add_executable(https_examples https_examples.cpp)
target_link_libraries(https_examples ${Boost_LIBRARIES})
target_link_libraries(https_examples ${OPENSSL_SSL_LIBRARIES})
target_link_libraries(https_examples ${OPENSSL_CRYPTO_LIBRARIES})
target_link_libraries(https_examples ${OPENSSL_LIBRARIES})
target_link_libraries(https_examples ${CMAKE_THREAD_LIBS_INIT})
add_executable(http_examples http_examples.cpp)
target_link_libraries(http_examples ${Boost_LIBRARIES})
target_link_libraries(http_examples ${CMAKE_THREAD_LIBS_INIT})
if(MSYS)
target_link_libraries(http_examples ws2_32 wsock32)
target_link_libraries(https_examples ws2_32 wsock32)
endif()
enable_testing()
add_subdirectory(test)

View file

@ -1,4 +1,11 @@
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-access-control")
add_executable(parse_test parse_test.cpp)
target_link_libraries(parse_test ${Boost_LIBRARIES})
target_link_libraries(parse_test ${CMAKE_THREAD_LIBS_INIT})
if(MSYS)
target_link_libraries(parse_test ws2_32 wsock32)
endif()
add_test(parse_test parse_test)

View file

@ -1,5 +1,3 @@
#define private public
#include "server_http.hpp"
#include "client_http.hpp"
#include <iostream>