Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
deanberris merged 5 commits intocpp-netlib:masterfromtorbjoernk:cmake-shared-libs
Nov 4, 2012
Merged
Changes from1 commit
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
NextNext commit
add CMake options for shared libs, tests, examples
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
@torbjoernk
torbjoernk committedNov 3, 2012
commiteaa0cacd0657037e25031d0137c735cce9e96a6e
50 changes: 41 additions & 9 deletionsCMakeLists.txt
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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 )

set(Boost_USE_STATIC_LIBS ON)
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)
find_package( Boost 1.45.0 REQUIRED unit_test_framework system regex date_time thread chrono filesystem program_options )
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} )
Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Author

Choose a reason for hiding this comment

The 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)
Expand DownExpand Up@@ -51,13 +69,27 @@ if (Boost_FOUND)
add_definitions(-D_WIN32_WINNT=0x0501)
endif(WIN32)
include_directories(${Boost_INCLUDE_DIRS})
enable_testing()
if(BUILD_TESTS)
enable_testing()
endif()
add_subdirectory(libs/network/src)
add_subdirectory(libs/network/test)
if (NOT MSVC)
add_subdirectory(libs/mime/test)
endif(NOT MSVC)
add_subdirectory(libs/network/example)
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)

enable_testing()
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)")

[8]ページ先頭

©2009-2025 Movatter.jp