Skip to content

Export dependency libraries. #515

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
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
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,12 @@ export(PACKAGE cppnetlib)
file(RELATIVE_PATH REL_INCLUDE_DIR "${INSTALL_CMAKE_DIR}"
"${CMAKE_INSTALL_FULL_INCLUDEDIR}")
# ... for the build tree
set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}")
set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}" ${Boost_INCLUDE_DIRS})
configure_file(cppnetlibConfig.cmake.in
"${PROJECT_BINARY_DIR}/cppnetlibConfig.cmake" @ONLY)
# ... for the install tree
set(CONF_INCLUDE_DIRS "\${CPPNETLIB_CMAKE_DIR}/${REL_INCLUDE_DIR}")
set(CONF_INCLUDE_DIRS ${CONF_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
configure_file(cppnetlibConfig.cmake.in
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/cppnetlibConfig.cmake" @ONLY)
# ... for both
Expand Down
8 changes: 4 additions & 4 deletions cppnetlibConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
# CPPNETLIB_INCLUDE_DIRS - include directories for cppnetlib
# CPPNETLIB_LIBRARIES - libraries to link against
# CPPNETLIB_EXECUTABLE - the bar executable

# Compute paths
get_filename_component(CPPNETLIB_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(CPPNETLIB_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@")

# Our library dependencies (contains definitions for IMPORTED targets)
if( NOT TARGET cppnetlib-client-connections
AND NOT TARGET cppnetlib-server-parsers
AND NOT TARGET cppnetlib-uri
AND NOT CPPNETLIB_BINARY_DIR)
include("${CPPNETLIB_CMAKE_DIR}/cppnetlibTargets.cmake")
endif()

# These are IMPORTED targets created by cppnetlibTargets.cmake
set(CPPNETLIB_LIBRARIES
set(CPPNETLIB_LIBRARIES
cppnetlib-client-connections
cppnetlib-server-parsers
cppnetlib-uri)
Expand Down
4 changes: 2 additions & 2 deletions libs/network/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

include_directories(${CPP-NETLIB_SOURCE_DIR})

file(GLOB_RECURSE CPP-NETLIB_HEADERS
file(GLOB_RECURSE CPP-NETLIB_HEADERS
"${CPP-NETLIB_SOURCE_DIR}/boost/" "*.hpp")

set(CPP-NETLIB_URI_SRCS uri/uri.cpp uri/schemes.cpp)
Expand Down Expand Up @@ -45,7 +45,7 @@ if (OPENSSL_FOUND)
target_link_libraries(cppnetlib-client-connections ${OPENSSL_LIBRARIES})
endif ()
if (Boost_FOUND)
target_link_libraries(cppnetlib-client-connections ${Boost_System_LIBRARY})
target_link_libraries(cppnetlib-client-connections ${Boost_LIBRARIES})
endif ()
install(TARGETS cppnetlib-client-connections
EXPORT cppnetlibTargets
Expand Down