Skip to content

Commit 724f6ad

Browse files
committed
create pkg-config file
1 parent 438eabe commit 724f6ad

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ if(CLI11_INSTALL)
224224
NAMESPACE CLI11::
225225
FILE CLI11Targets.cmake)
226226

227+
include(cmake/CLI11GeneratePkgConfig.cmake)
228+
227229
# Register in the user cmake package registry
228230
export(PACKAGE CLI11)
229231
endif()

cmake/CLI11.pc.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
prefix=@CMAKE_INSTALL_PREFIX@
2+
exec_prefix=${prefix}
3+
includedir=${prefix}/include
4+
5+
Name: CLI11
6+
Description: C++ command line parser
7+
Version: @PROJECT_VERSION@
8+
9+
Cflags: -I${includedir}

cmake/CLI11GeneratePkgConfig.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
configure_file("cmake/CLI11.pc.in" "CLI11.pc" @ONLY)
2+
3+
install(FILES "${PROJECT_BINARY_DIR}/CLI11.pc"
4+
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
5+
6+

0 commit comments

Comments
 (0)