|
7 | 7 | cmake_minimum_required(VERSION 2.8)
|
8 | 8 | project(CPP-NETLIB)
|
9 | 9 |
|
10 |
| -option(BUILD_SHARED_LIBS "Build cpp-netlib as shared libraries." OFF) |
11 |
| -option(BUILD_TESTS "Build the unit tests." ON) |
12 |
| -option(BUILD_EXAMPLES "Build the examples using cpp-netlib." ON) |
| 10 | +option( CPP-NETLIB_BUILD_SHARED_LIBS "Build cpp-netlib as shared libraries." OFF ) |
| 11 | +option( CPP-NETLIB_BUILD_TESTS "Build the unit tests." ON ) |
| 12 | +option( CPP-NETLIB_BUILD_EXAMPLES "Build the examples using cpp-netlib." ON ) |
| 13 | +option( CPP-NETLIB_ALWAYS_LOGGING "Allow cpp-netlib to log debug messages even in non-debug mode." OFF ) |
| 14 | +option( CPP-NETLIB_DISABLE_LOGGING "Disable logging definitely, no logging code will be generated or compiled." OFF ) |
| 15 | + |
13 | 16 |
|
14 | 17 | set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
15 | 18 | find_package( ICU )
|
16 | 19 |
|
17 |
| -if(BUILD_SHARED_LIBS) |
| 20 | +if(CPP-NETLIB_BUILD_SHARED_LIBS) |
18 | 21 | set(Boost_USE_STATIC_LIBS OFF)
|
19 | 22 | else()
|
20 | 23 | set(Boost_USE_STATIC_LIBS ON)
|
21 | 24 | endif()
|
22 | 25 | set(Boost_USE_MULTITHREADED ON)
|
23 |
| -if(BUILD_TESTS) |
| 26 | +if(CPP-NETLIB_BUILD_TESTS) |
24 | 27 | set(Boost_COMPONENTS unit_test_framework system regex date_time thread chrono filesystem program_options )
|
25 | 28 | else()
|
26 | 29 | set(Boost_COMPONENTS system regex date_time thread chrono filesystem program_options )
|
@@ -75,27 +78,29 @@ if (Boost_FOUND)
|
75 | 78 | add_definitions(-D_WIN32_WINNT=0x0501)
|
76 | 79 | endif(WIN32)
|
77 | 80 | include_directories(${Boost_INCLUDE_DIRS})
|
78 |
| - if(BUILD_TESTS) |
| 81 | + if(CPP-NETLIB_BUILD_TESTS) |
79 | 82 | enable_testing()
|
80 | 83 | endif()
|
81 | 84 | add_subdirectory(libs/network/src)
|
82 |
| - if(BUILD_TESTS) |
| 85 | + if(CPP-NETLIB_BUILD_TESTS) |
83 | 86 | enable_testing()
|
84 | 87 | add_subdirectory(libs/network/test)
|
85 | 88 | if (NOT MSVC)
|
86 | 89 | add_subdirectory(libs/mime/test)
|
87 | 90 | endif(NOT MSVC)
|
88 | 91 | endif()
|
89 |
| - if(BUILD_EXAMPLES) |
| 92 | + if(CPP-NETLIB_BUILD_EXAMPLES) |
90 | 93 | add_subdirectory(libs/network/example)
|
91 | 94 | endif()
|
92 | 95 | endif(Boost_FOUND)
|
93 | 96 |
|
94 |
| -if(BUILD_TESTS) |
| 97 | +if(CPP-NETLIB_BUILD_TESTS) |
95 | 98 | enable_testing()
|
96 | 99 | endif()
|
97 | 100 |
|
98 |
| -message(STATUS "Options selected:") |
99 |
| -message(STATUS " BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}\t(Build cpp-netlib as shared libraries: OFF, ON)") |
100 |
| -message(STATUS " BUILD_TESTS: ${BUILD_TESTS}\t(Build the unit tests: ON, OFF)") |
101 |
| -message(STATUS " BUILD_EXAMPLES: ${BUILD_EXAMPLES}\t(Build the examples using cpp-netlib: ON, OFF)") |
| 101 | +message(STATUS "CPP-NETLIB Options selected:") |
| 102 | +message(STATUS " CPP-NETLIB_BUILD_SHARED_LIBS: ${CPP-NETLIB_BUILD_SHARED_LIBS}\t(Build cpp-netlib as shared libraries: OFF, ON)") |
| 103 | +message(STATUS " CPP-NETLIB_BUILD_TESTS: ${CPP-NETLIB_BUILD_TESTS}\t(Build the unit tests: ON, OFF)") |
| 104 | +message(STATUS " CPP-NETLIB_BUILD_EXAMPLES: ${CPP-NETLIB_BUILD_EXAMPLES}\t(Build the examples using cpp-netlib: ON, OFF)") |
| 105 | +message(STATUS " CPP-NETLIB_ALWAYS_LOGGING: ${CPP-NETLIB_ALWAYS_LOGGING}\t(Allow cpp-netlib to log debug messages even in non-debug mode: ON, OFF)") |
| 106 | +message(STATUS " CPP-NETLIB_DISABLE_LOGGING: ${CPP-NETLIB_DISABLE_LOGGING}\t(Disable logging definitely, no logging code will be generated or compiled: ON, OFF)") |
0 commit comments