Skip to content

Commit 65713d8

Browse files
committed
Merge pull request #404 from cmorse/0.11-devel
Added CMake options to disable building tests and examples
2 parents 8510393 + 24d8139 commit 65713d8

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

CMakeLists.txt

+10-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ cmake_minimum_required(VERSION 2.8)
77
project(CPP-NETLIB)
88

99
option( CPP-NETLIB_BUILD_SHARED_LIBS "Build cpp-netlib as shared libraries." OFF )
10+
option( CPP-NETLIB_BUILD_TESTS "Build the cpp-netlib project tests." ON)
11+
option( CPP-NETLIB_BUILD_EXAMPLES "Build the cpp-netlib project examples." ON)
1012

1113
include(GNUInstallDirs)
1214

@@ -82,12 +84,16 @@ if (Boost_FOUND)
8284
include_directories(${Boost_INCLUDE_DIRS})
8385
enable_testing()
8486
add_subdirectory(libs/network/src)
85-
add_subdirectory(libs/network/test)
87+
if (CPP-NETLIB_BUILD_TESTS)
88+
add_subdirectory(libs/network/test)
89+
endif (CPP-NETLIB_BUILD_TESTS)
8690
add_subdirectory(libs/network/experiment)
87-
if (NOT MSVC)
91+
if (NOT MSVC AND CPP-NETLIB_BUILD_TESTS)
8892
add_subdirectory(libs/mime/test)
89-
endif(NOT MSVC)
90-
add_subdirectory(libs/network/example)
93+
endif(NOT MSVC AND CPP-NETLIB_BUILD_TESTS)
94+
if (CPP-NETLIB_BUILD_EXAMPLES)
95+
add_subdirectory(libs/network/example)
96+
endif (CPP-NETLIB_BUILD_EXAMPLES)
9197
endif(Boost_FOUND)
9298

9399
if (MSVC)

0 commit comments

Comments
 (0)