Skip to content

Commit

Permalink
fixed pkg-config
Browse files Browse the repository at this point in the history
  • Loading branch information
likle committed Jan 7, 2024
1 parent 82ecee1 commit 82b51a3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.14.7)
project(cargs
VERSION 1.1.0
DESCRIPTION "A simple argument parser library"
HOMEPAGE_URL "https://likle.github.io/cargs/"
LANGUAGES C)

# include utilities
Expand Down Expand Up @@ -108,6 +109,10 @@ configure_package_config_file("cmake/CargsConfig.cmake.in"
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/CargsConfigVersion.cmake
COMPATIBILITY SameMajorVersion)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/cargs.pc.in
${CMAKE_CURRENT_BINARY_DIR}/cargs.pc
@ONLY)

# installing
install(TARGETS cargs
Expand All @@ -117,5 +122,8 @@ install(FILES
${CMAKE_CURRENT_BINARY_DIR}/CargsConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/CargsConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cargs)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/cargs.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(EXPORT CargsTargets
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/cargs)
10 changes: 7 additions & 3 deletions cargs.pc.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
prefix="@CMAKE_INSTALL_PREFIX@"
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: @PROJECT_NAME@
Description: @CMAKE_PROJECT_DESCRIPTION@
URL: @CMAKE_PROJECT_HOMEPAGE_URL@
Version: @PROJECT_VERSION@
Cflags: -I"${includedir}"
Libs: -L"${prefix}/lib" -lcargs
Libs: -L${libdir} -lcargs
Cflags: -I${includedir}

0 comments on commit 82b51a3

Please sign in to comment.