Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create and install project pkg-config file #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ write_basic_package_version_file(
${CONFIG_VERSION_FILE} COMPATIBILITY AnyNewerVersion
)

# Generate pkg-config .pc file
set(PKGCONFIG_INSTALL_DIR
${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig
CACHE PATH "Installation directory for pkg-config (${PROJECT_NAME}.pc) file"
)
configure_file(
"${PROJECT_NAME}.pc.in"
"${PROJECT_NAME}.pc"
@ONLY
)

install(DIRECTORY include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING PATTERN "*.h"
Expand All @@ -35,6 +46,9 @@ install(EXPORT ${PROJECT_NAME}-config
install(FILES ${CONFIG_VERSION_FILE}
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
DESTINATION ${PKGCONFIG_INSTALL_DIR}
)

option(BUILD_TESTING "Do not build tests by default" OFF)
include(CTest)
Expand Down
8 changes: 8 additions & 0 deletions clipp.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
prefix=@CMAKE_INSTALL_PREFIX@
includedir=${prefix}/include

Name: @PROJECT_NAME@
Description: Easy to use, powerful and expressive command line argument handling for C++11/14/17 contained in a single header file
URL: https://github.com/muellan/clipp
Version: @clipp_VERSION@
Cflags: -I${includedir}