diff --git a/CMakeLists.txt b/CMakeLists.txt index 799cdd8..bf9d967 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 @@ -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 @@ -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) diff --git a/cargs.pc.in b/cargs.pc.in index d8cd061..25585f3 100644 --- a/cargs.pc.in +++ b/cargs.pc.in @@ -1,7 +1,11 @@ -prefix="@CMAKE_INSTALL_PREFIX@" -Name: @PROJECT_NAME@ +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 \ No newline at end of file +Libs: -L${libdir} -lcargs +Cflags: -I${includedir} \ No newline at end of file