Skip to content
Snippets Groups Projects
Commit a4030cd8 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

add pkgconfig file

Change-Id: I8948adf1e15a2baad3d67400d8940902807bf9ed
parent 8f48214c
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,10 @@ set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(CTest)
include(GNUInstallDirs)
set (prefix ${CMAKE_INSTALL_PREFIX})
set (exec_prefix "\${prefix}")
set (libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
set (includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
find_package (PkgConfig REQUIRED)
find_package(msgpack REQUIRED QUIET CONFIG NAMES msgpack msgpack-cxx)
......@@ -39,12 +43,18 @@ target_include_directories(dhtnet PUBLIC
$<INSTALL_INTERFACE:include>
)
target_compile_definitions(dhtnet PUBLIC PJ_AUTOCONF=1)
set_target_properties(dhtnet PROPERTIES PUBLIC_HEADER "${dhtnet_HEADERS}")
configure_file(dhtnet.pc.in dhtnet.pc @ONLY)
install(TARGETS dhtnet
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dhtnet
)
# Install targets
install (DIRECTORY include DESTINATION ${CMAKE_INSTALL_PREFIX})
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/opendht.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
if (BUILD_TESTING AND NOT MSVC)
pkg_search_module(Cppunit REQUIRED IMPORTED_TARGET cppunit)
add_executable(tests_certstore tests/certstore.cpp)
......
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: dhtnet
Description: C++ peer to peer networking library
Version: @VERSION@
Requires: opendht >= 2.6
Requires.private: pjproject
Cflags: -I${includedir}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment