From: Kristóf Katus Date: Fri, 26 Aug 2011 09:37:10 +0000 (+0200) Subject: Small corrections to Libt2n.cmake - linking the boost serialization library to the... X-Git-Tag: latest_release~13 X-Git-Url: http://developer.intra2net.com/git/?p=libt2n;a=commitdiff_plain;h=34721cc426d4664e002391ac8e7bd96215cd278f Small corrections to Libt2n.cmake - linking the boost serialization library to the client libraries. --- diff --git a/codegen/Libt2n.cmake b/codegen/Libt2n.cmake index a31edee..f547fe9 100644 --- a/codegen/Libt2n.cmake +++ b/codegen/Libt2n.cmake @@ -1,8 +1,14 @@ -# Detect libt2n. Version of this file: 1.2 +# Version of this file: 1.3 + +# Detect libt2n pkg_check_modules(LIBT2N REQUIRED libt2n) include_directories(${LIBT2N_INCLUDE_DIRS}) link_directories(${LIBT2N_LIBRARY_DIRS}) +# Detect the boost serialization library +find_package(Boost 1.34 COMPONENTS serialization REQUIRED) +include_directories(${Boost_INCLUDE_DIRS}) + # Get locations from pkgconfig execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable libt2n_codegen libt2n OUTPUT_VARIABLE LIBT2N_CODEGEN @@ -87,11 +93,13 @@ function(setup_libt2n) # Create shared client library add_library(${CMDGROUP} SHARED ${CMDGROUP}_client.cpp ${CMDGROUP}_client.hxx) set_target_properties(${CMDGROUP} PROPERTIES VERSION ${VERSION} SOVERSION 1) + target_link_libraries(${CMDGROUP} ${Boost_SERIALIZATION_LIBRARIES}) install(TARGETS ${CMDGROUP} LIBRARY DESTINATION lib COMPONENT sharedlibs) # Create static client library add_library(${CMDGROUP}-static STATIC ${CMDGROUP}_client.cpp ${CMDGROUP}_client.hxx) set_target_properties(${CMDGROUP}-static PROPERTIES OUTPUT_NAME "${CMDGROUP}") + target_link_libraries(${CMDGROUP}-static ${Boost_SERIALIZATION_LIBRARIES}) install(TARGETS ${CMDGROUP}-static ARCHIVE DESTINATION lib COMPONENT staticlibs) # Prevent clobbering each other during the build diff --git a/examples-codegen/cmake/CMakeLists.txt b/examples-codegen/cmake/CMakeLists.txt index 60bb8d1..8ed2c7e 100644 --- a/examples-codegen/cmake/CMakeLists.txt +++ b/examples-codegen/cmake/CMakeLists.txt @@ -6,11 +6,12 @@ set(t2n_mydaemon_GROUP ${CMAKE_SOURCE_DIR}/src/t2n_mydaemon.cpp ) include(${CMAKE_SOURCE_DIR}/codegen/Libt2n.cmake) +# Or "include(Libt2n)" if Libt2n.cmake is already installed in /${CMAKE_ROOT}/Modules # Call setup_libt2n with the CMDGROUP name setup_libt2n(t2n_mydaemon) -# ------------------------------------------------------------------------------------------------------ +# -------------------------------------------------------------------------------- set(keymaker_cpp_sources something.cpp