add_pkg_config
authorScott Kitterman <scott@kitterman.com>
Thu, 28 Dec 2017 16:00:03 +0000 (16:00 +0000)
committerScott Kitterman <scott@kitterman.com>
Thu, 28 Dec 2017 16:00:03 +0000 (16:00 +0000)
===================================================================

Gbp-Pq: Name add_pkg_config.patch

CMakeLists.txt
libnitrokey.pc.in [new file with mode: 0644]

index 8259f67de4e2494c7b84051a4424c2a1201c2a4d..c4a914b3de7d2f46c8c052a799288c6bd69e2b9a 100644 (file)
@@ -133,6 +133,10 @@ file(GLOB LIB_INCLUDES "include/*.h")
 install (FILES ${LIB_INCLUDES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libnitrokey)
 install (TARGETS ${LIBNAME} 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 (file)
index 0000000..17cde1d
--- /dev/null
@@ -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}