aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2017-12-02 22:39:26 +0100
committerSzczepan Zalega <szczepan@nitrokey.com>2017-12-11 13:47:36 +0100
commitfc1fe95c32e8cd6ee362c85c036a68ee1554345e (patch)
tree8859e0464036853e9b7dd7dc8f40b05c2dd4aa90
parent2dd39700b452afadf8993d27b6a81650d2bb628b (diff)
downloadlibnitrokey-fc1fe95c32e8cd6ee362c85c036a68ee1554345e.tar.gz
libnitrokey-fc1fe95c32e8cd6ee362c85c036a68ee1554345e.tar.bz2
Add support for pkg-config
-rw-r--r--CMakeLists.txt4
-rw-r--r--libnitrokey.pc.in10
2 files changed, 14 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 372918e..78d0116 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -120,6 +120,10 @@ file(GLOB LIB_INCLUDES "include/*.h")
install (FILES ${LIB_INCLUDES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME})
install (TARGETS nitrokey DESTINATION ${CMAKE_INSTALL_LIBDIR})
+# configure and install pkg-config file
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libnitrokey.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libnitrokey-1.pc @ONLY)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libnitrokey-1.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+
OPTION(COMPILE_TESTS "Compile tests" FALSE)
OPTION(COMPILE_OFFLINE_TESTS "Compile offline tests" FALSE)
diff --git a/libnitrokey.pc.in b/libnitrokey.pc.in
new file mode 100644
index 0000000..17cde1d
--- /dev/null
+++ b/libnitrokey.pc.in
@@ -0,0 +1,10 @@
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+
+Name: libnitrokey
+Description: Library for communicating with Nitrokey in a clean and easy manner
+Version: @libnitrokey_VERSION@
+Requires.private: hidapi-libusb
+
+Libs: -L${libdir} -lnitrokey
+Cflags: -I${includedir}