forked from cpp-netlib/cpp-netlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
59 lines (50 loc) · 1.64 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Copyright (c) Dean Michael Berris 2010.
# Copyright (c) Google, Inc. 2012.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
cmake_minimum_required(VERSION 2.8)
project(CPP-NETLIB)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
find_package( ICU )
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
find_package( Boost 1.45.0 REQUIRED unit_test_framework system regex date_time thread chrono filesystem program_options )
find_package( OpenSSL )
find_package( Threads )
set(CMAKE_VERBOSE_MAKEFILE true)
if (CMAKE_BUILD_TYPE MATCHES Debug)
add_definitions(-DBOOST_NETWORK_DEBUG)
endif()
if (OPENSSL_FOUND)
add_definitions(-DBOOST_NETWORK_ENABLE_HTTPS)
endif()
if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU)
INCLUDE(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG(-std=c++0x HAVE_STD0X)
CHECK_CXX_COMPILER_FLAG(-std=c++11 HAVE_STD11)
if (HAVE_STD11)
set(CMAKE_CXX_FLAGS -std=c++11)
elseif (HAVE_STD0X)
set(CMAKE_CXX_FLAGS -std=c++0x)
else()
message(FATAL_ERROR "No advanced standard C++ support (-std=c++0x and -std=c++11 not defined).")
endif()
endif()
if (Boost_FOUND)
if (MSVC)
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
endif(MSVC)
if (WIN32)
add_definitions(-D_WIN32_WINNT=0x0501)
endif(WIN32)
include_directories(${Boost_INCLUDE_DIRS})
enable_testing()
add_subdirectory(libs/network/src)
add_subdirectory(libs/network/test)
if (NOT MSVC)
add_subdirectory(libs/mime/test)
endif(NOT MSVC)
add_subdirectory(libs/network/example)
endif(Boost_FOUND)
enable_testing()