From d80ea3996f6189cb56e4f85937b2984fbd20eb4c Mon Sep 17 00:00:00 2001 From: Marcin Puc Date: Sun, 16 Apr 2023 06:55:52 +0200 Subject: [PATCH] Generate and install pkgconfig file --- src/CMakeLists.txt | 12 ++++++++++++ src/liboqs.pc.in | 10 ++++++++++ 2 files changed, 22 insertions(+) create mode 100644 src/liboqs.pc.in diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5632e30e06..d0698cc88f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -91,12 +91,24 @@ write_basic_package_version_file( COMPATIBILITY AnyNewerVersion ) +# generate pkg-config file +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/liboqs.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/liboqs.pc + @ONLY +) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/liboqsConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/liboqsConfigVersion.cmake" DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/liboqs" ) +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/liboqs.pc" + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig +) + install(TARGETS oqs EXPORT liboqsTargets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/src/liboqs.pc.in b/src/liboqs.pc.in new file mode 100644 index 0000000000..4759341e24 --- /dev/null +++ b/src/liboqs.pc.in @@ -0,0 +1,10 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: @PROJECT_NAME@ +Description: Library for quantum-safe cryptographic algorithms +Version: @OQS_VERSION_TEXT@ +Requires.private: openssl +Cflags: -I${includedir} +Libs: -L${libdir} -loqs