- Notifications
You must be signed in to change notification settings - Fork425
Enable build of cpp-netlib as shared libraries#165
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
eaa0cac0ca215ca9cc84a8fdaa5a8131f49File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
Add options to CMake to enable build of cpp-netlib as shared libraries.New options are: BUILD_SHARED_LIBS (default OFF) BUILD_TESTS (default ON) BUILD_EXAMPLES (default ON)As the current (CMakeLists-)setup of the tests and examples does notwork with a shared cpp-netlib build, those get not build then.Specify with `cmake -D<OPTION>=<ON|OFF>`
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -7,12 +7,30 @@ | ||
| cmake_minimum_required(VERSION 2.8) | ||
| project(CPP-NETLIB) | ||
| option(BUILD_SHARED_LIBS "Build cpp-netlib as shared libraries." OFF) | ||
| option(BUILD_TESTS "Build the unit tests." ON) | ||
| option(BUILD_EXAMPLES "Build the examples using cpp-netlib." ON) | ||
| set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) | ||
| find_package( ICU ) | ||
| if(BUILD_SHARED_LIBS) | ||
| set(Boost_USE_STATIC_LIBS OFF) | ||
| # TODO/NOTE: | ||
| # the unit tests and examples won't compile with the current setup and | ||
| # shared libraries yet | ||
| set(BUILD_TESTS OFF) | ||
| set(BUILD_EXAMPLES OFF) | ||
| else() | ||
| set(Boost_USE_STATIC_LIBS ON) | ||
| endif() | ||
| set(Boost_USE_MULTITHREADED ON) | ||
| if(BUILD_TESTS) | ||
| set(Boost_COMPONENTS unit_test_framework system regex date_time thread chrono filesystem program_options ) | ||
| else() | ||
| set(Boost_COMPONENTS system regex date_time thread chrono filesystem program_options ) | ||
| endif() | ||
| find_package( Boost 1.45.0 REQUIRED ${Boost_COMPONENTS} ) | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I've always meant to upgrade this to 1.51 -- would you mind changing this to 1.51 now? Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Nothing easier than that. I've only tested with Boost 1.51.0 though. | ||
| find_package( OpenSSL ) | ||
| find_package( Threads ) | ||
| set(CMAKE_VERBOSE_MAKEFILE true) | ||
| @@ -51,13 +69,27 @@ if (Boost_FOUND) | ||
| add_definitions(-D_WIN32_WINNT=0x0501) | ||
| endif(WIN32) | ||
| include_directories(${Boost_INCLUDE_DIRS}) | ||
| if(BUILD_TESTS) | ||
| enable_testing() | ||
| endif() | ||
| add_subdirectory(libs/network/src) | ||
| if(BUILD_TESTS) | ||
| enable_testing() | ||
| add_subdirectory(libs/network/test) | ||
| if (NOT MSVC) | ||
| add_subdirectory(libs/mime/test) | ||
| endif(NOT MSVC) | ||
| endif() | ||
| if(BUILD_EXAMPLES) | ||
| add_subdirectory(libs/network/example) | ||
| endif() | ||
| endif(Boost_FOUND) | ||
| if(BUILD_TESTS) | ||
| enable_testing() | ||
| endif() | ||
| message(STATUS "Options selected:") | ||
| message(STATUS " BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}\t(Build cpp-netlib as shared libraries: OFF, ON)") | ||
| message(STATUS " BUILD_TESTS: ${BUILD_TESTS}\t(Build the unit tests: ON, OFF)") | ||
| message(STATUS " BUILD_EXAMPLES: ${BUILD_EXAMPLES}\t(Build the examples using cpp-netlib: ON, OFF)") | ||