Skip to content
Open
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
44 changes: 32 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,25 @@ if (NOT MSVC)
# libfmt
pkg_search_module (fmt REQUIRED IMPORTED_TARGET fmt)
# libreadline
if (OPENDHT_TOOLS AND NOT APPLE)
pkg_search_module(readline REQUIRED IMPORTED_TARGET readline)
message(STATUS "libreadline: version ${readline_VERSION}")
set(READLINE_VERSION ${readline_VERSION})
if(READLINE_VERSION VERSION_LESS 6)
message(SEND_ERROR "libreadline: required version 6.0 or later")
if (OPENDHT_TOOLS AND NOT APPLE)
if("${CMAKE_SYSTEM_NAME}" MATCHES "OpenBSD")
# use OpenBSD-readline (not GNU)
find_library(readline NAMES readline PATHS ${CMAKE_LIBRARY_PATH})
if("${readline}" MATCHES "readline-NOTFOUND")
message(SEND_ERROR "libreadline: not found")
else()
set(READLINE_LIBRARIES readline)
endif()
else()
pkg_search_module(readline REQUIRED IMPORTED_TARGET readline)
message(STATUS "libreadline: version ${readline_VERSION}")
set(READLINE_VERSION ${readline_VERSION})
if(READLINE_VERSION VERSION_LESS 6)
message(SEND_ERROR "libreadline: required version 6.0 or later")
endif()
set(READLINE_LIBRARIES ${readline_LIBRARIES})
link_directories(${readline_LIBRARY_DIRS})
endif()
set(READLINE_LIBRARIES ${readline_LIBRARIES})
endif ()
# ASIO
if (OPENDHT_HTTP OR OPENDHT_PEER_DISCOVERY)
Expand Down Expand Up @@ -653,12 +664,21 @@ if (BUILD_SHARED_LIBS)
target_compile_definitions(opendht PUBLIC opendht_EXPORTS)
endif ()

if(("${CMAKE_SYSTEM_NAME}" MATCHES "OpenBSD") OR
("${CMAKE_SYSTEM_NAME}" MATCHES "NetBSD") OR
("${CMAKE_SYSTEM_NAME}" MATCHES "DragonFly"))
install (TARGETS opendht
DESTINATION ${CMAKE_INSTALL_LIBDIR}
EXPORT opendht
)
else()
install (TARGETS opendht
DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME_DEPENDENCY_SET opendht_rdeps
EXPORT opendht
)
endif()

install (TARGETS opendht
DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME_DEPENDENCY_SET opendht_rdeps
EXPORT opendht
)
if (WIN32)
install(RUNTIME_DEPENDENCY_SET opendht_rdeps
PRE_EXCLUDE_REGEXES
Expand Down
Loading