Skip to content

add CMake definitions to build and install shared libraries and headers #288

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
Aug 29, 2013
Merged
Show file tree
Hide file tree
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
add CMake definitions to build and install shared libraries and headers
  • Loading branch information
Ximin Luo committed Aug 29, 2013
commit 75ffadb14222f83a6fbb43789898c4b5589a7d78
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ find_package( OpenSSL )
find_package( Threads )
set(CMAKE_VERBOSE_MAKEFILE true)

set(BUILD_SHARED_LIBS ON)
set(CPPNETLIB_VERSION_MAJOR 0) # MUST bump this whenever we make ABI-incompatible changes
set(CPPNETLIB_VERSION_MINOR 10)
set(CPPNETLIB_VERSION_PATCH 1)
set(CPPNETLIB_VERSION_STRING ${CPPNETLIB_VERSION_MAJOR}.${CPPNETLIB_VERSION_MINOR}.${CPPNETLIB_VERSION_PATCH})

if (CMAKE_BUILD_TYPE MATCHES Debug)
add_definitions(-DBOOST_NETWORK_DEBUG)
endif()
Expand Down Expand Up @@ -60,3 +66,5 @@ if (MSVC)
endif()

enable_testing()

install(DIRECTORY boost DESTINATION "include")
9 changes: 9 additions & 0 deletions libs/network/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,18 @@ include_directories(${CPP-NETLIB_SOURCE_DIR})

set(CPP-NETLIB_URI_SRCS uri/uri.cpp uri/schemes.cpp)
add_library(cppnetlib-uri ${CPP-NETLIB_URI_SRCS})
set_target_properties(cppnetlib-uri
PROPERTIES VERSION ${CPPNETLIB_VERSION_STRING} SOVERSION ${CPPNETLIB_VERSION_MAJOR})
install(TARGETS cppnetlib-uri DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE})

set(CPP-NETLIB_HTTP_SERVER_SRCS server_request_parsers_impl.cpp)
add_library(cppnetlib-server-parsers ${CPP-NETLIB_HTTP_SERVER_SRCS})
set_target_properties(cppnetlib-server-parsers
PROPERTIES VERSION ${CPPNETLIB_VERSION_STRING} SOVERSION ${CPPNETLIB_VERSION_MAJOR})
install(TARGETS cppnetlib-server-parsers DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE})

set(CPP-NETLIB_HTTP_CLIENT_SRCS client.cpp)
add_library(cppnetlib-client-connections ${CPP-NETLIB_HTTP_CLIENT_SRCS})
set_target_properties(cppnetlib-client-connections
PROPERTIES VERSION ${CPPNETLIB_VERSION_STRING} SOVERSION ${CPPNETLIB_VERSION_MAJOR})
install(TARGETS cppnetlib-client-connections DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE})