From e50a75f23157bf6b0a79ba64cc783766ff7dc3d9 Mon Sep 17 00:00:00 2001 From: djerius Date: Wed, 28 Oct 2020 12:06:05 -0400 Subject: [PATCH] feat: create pkg-config file (#523) --- CMakeLists.txt | 2 ++ cmake/CLI11.pc.in | 9 +++++++++ cmake/CLI11GeneratePkgConfig.cmake | 6 ++++++ 3 files changed, 17 insertions(+) create mode 100644 cmake/CLI11.pc.in create mode 100644 cmake/CLI11GeneratePkgConfig.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 574ca1ee..f3df2744 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -224,6 +224,8 @@ if(CLI11_INSTALL) NAMESPACE CLI11:: FILE CLI11Targets.cmake) + include(cmake/CLI11GeneratePkgConfig.cmake) + # Register in the user cmake package registry export(PACKAGE CLI11) endif() diff --git a/cmake/CLI11.pc.in b/cmake/CLI11.pc.in new file mode 100644 index 00000000..8d418739 --- /dev/null +++ b/cmake/CLI11.pc.in @@ -0,0 +1,9 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +includedir=${prefix}/include + +Name: CLI11 +Description: C++ command line parser +Version: @PROJECT_VERSION@ + +Cflags: -I${includedir} diff --git a/cmake/CLI11GeneratePkgConfig.cmake b/cmake/CLI11GeneratePkgConfig.cmake new file mode 100644 index 00000000..667705d2 --- /dev/null +++ b/cmake/CLI11GeneratePkgConfig.cmake @@ -0,0 +1,6 @@ +configure_file("cmake/CLI11.pc.in" "CLI11.pc" @ONLY) + +install(FILES "${PROJECT_BINARY_DIR}/CLI11.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + +