Skip to content

Commit 892c4c5

Browse files
committed
Gathered and prefixed all CMake options.
1 parent 8e63590 commit 892c4c5

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

CMakeLists.txt

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,23 @@
77
cmake_minimum_required(VERSION 2.8)
88
project(CPP-NETLIB)
99

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+
1316

1417
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
1518
find_package( ICU )
1619

17-
if(BUILD_SHARED_LIBS)
20+
if(CPP-NETLIB_BUILD_SHARED_LIBS)
1821
set(Boost_USE_STATIC_LIBS OFF)
1922
else()
2023
set(Boost_USE_STATIC_LIBS ON)
2124
endif()
2225
set(Boost_USE_MULTITHREADED ON)
23-
if(BUILD_TESTS)
26+
if(CPP-NETLIB_BUILD_TESTS)
2427
set(Boost_COMPONENTS unit_test_framework system regex date_time thread chrono filesystem program_options )
2528
else()
2629
set(Boost_COMPONENTS system regex date_time thread chrono filesystem program_options )
@@ -56,8 +59,6 @@ elseif(${CMAKE_CXX_COMPILER_ID} MATCHES Clang)
5659
message("C++ Flags: ${CMAKE_CXX_FLAGS} link flags: ${CMAKE_CXX_LINK_FLAGS}")
5760
endif()
5861

59-
option( CPP-NETLIB_ALWAYS_LOGGING "Allow cpp-netlib to log debug messages even in non-debug mode." FALSE )
60-
option( CPP-NETLIB_DISABLE_LOGGING "Disable logging definitely, no logging code will be generated or compiled." FALSE )
6162

6263
if (Boost_FOUND)
6364
if (MSVC)
@@ -67,27 +68,29 @@ if (Boost_FOUND)
6768
add_definitions(-D_WIN32_WINNT=0x0501)
6869
endif(WIN32)
6970
include_directories(${Boost_INCLUDE_DIRS})
70-
if(BUILD_TESTS)
71+
if(CPP-NETLIB_BUILD_TESTS)
7172
enable_testing()
7273
endif()
7374
add_subdirectory(libs/network/src)
74-
if(BUILD_TESTS)
75+
if(CPP-NETLIB_BUILD_TESTS)
7576
enable_testing()
7677
add_subdirectory(libs/network/test)
7778
if (NOT MSVC)
7879
add_subdirectory(libs/mime/test)
7980
endif(NOT MSVC)
8081
endif()
81-
if(BUILD_EXAMPLES)
82+
if(CPP-NETLIB_BUILD_EXAMPLES)
8283
add_subdirectory(libs/network/example)
8384
endif()
8485
endif(Boost_FOUND)
8586

86-
if(BUILD_TESTS)
87+
if(CPP-NETLIB_BUILD_TESTS)
8788
enable_testing()
8889
endif()
8990

90-
message(STATUS "Options selected:")
91-
message(STATUS " BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}\t(Build cpp-netlib as shared libraries: OFF, ON)")
92-
message(STATUS " BUILD_TESTS: ${BUILD_TESTS}\t(Build the unit tests: ON, OFF)")
93-
message(STATUS " BUILD_EXAMPLES: ${BUILD_EXAMPLES}\t(Build the examples using cpp-netlib: ON, OFF)")
91+
message(STATUS "CPP-NETLIB Options selected:")
92+
message(STATUS " CPP-NETLIB_BUILD_SHARED_LIBS: ${CPP-NETLIB_BUILD_SHARED_LIBS}\t(Build cpp-netlib as shared libraries: OFF, ON)")
93+
message(STATUS " CPP-NETLIB_BUILD_TESTS: ${CPP-NETLIB_BUILD_TESTS}\t(Build the unit tests: ON, OFF)")
94+
message(STATUS " CPP-NETLIB_BUILD_EXAMPLES: ${CPP-NETLIB_BUILD_EXAMPLES}\t(Build the examples using cpp-netlib: ON, OFF)")
95+
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)")
96+
message(STATUS " CPP-NETLIB_DISABLE_LOGGING: ${CPP-NETLIB_DISABLE_LOGGING}\t(Disable logging definitely, no logging code will be generated or compiled: ON, OFF)")

libs/network/test/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
include_directories(${CPP-NETLIB_SOURCE_DIR}/include)
77

8-
if(BUILD_SHARED_LIBS)
9-
add_definitions(-DBUILD_SHARED_LIBS)
8+
if(CPP-NETLIB_BUILD_SHARED_LIBS)
9+
add_definitions(-DCPP-NETLIB_BUILD_SHARED_LIBS)
1010
endif()
1111

1212
add_subdirectory(logging)

0 commit comments

Comments
 (0)