Skip to content

Added CMake options to disable building tests and examples #404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 21, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ cmake_minimum_required(VERSION 2.8)
project(CPP-NETLIB)

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

include(GNUInstallDirs)

Expand Down Expand Up @@ -82,12 +84,16 @@ if (Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
enable_testing()
add_subdirectory(libs/network/src)
add_subdirectory(libs/network/test)
if (CPP-NETLIB_BUILD_TESTS)
add_subdirectory(libs/network/test)
endif (CPP-NETLIB_BUILD_TESTS)
add_subdirectory(libs/network/experiment)
if (NOT MSVC)
if (NOT MSVC AND CPP-NETLIB_BUILD_TESTS)
add_subdirectory(libs/mime/test)
endif(NOT MSVC)
add_subdirectory(libs/network/example)
endif(NOT MSVC AND CPP-NETLIB_BUILD_TESTS)
if (CPP-NETLIB_BUILD_EXAMPLES)
add_subdirectory(libs/network/example)
endif (CPP-NETLIB_BUILD_EXAMPLES)
endif(Boost_FOUND)

if (MSVC)
Expand Down