Skip to content

Commit

Permalink
add a pkg-config file
Browse files Browse the repository at this point in the history
  • Loading branch information
selfisekai committed Dec 16, 2023
1 parent 3a5add8 commit 86a0d2b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
13 changes: 12 additions & 1 deletion CMakeLists.txt
Expand Up @@ -17,7 +17,10 @@ if (POLICY CMP0127)
cmake_policy(SET CMP0127 NEW)
endif()

project(base64 LANGUAGES C VERSION 0.5.1)
project(base64 LANGUAGES C
VERSION 0.5.1
DESCRIPTION "Fast Base64 stream encoder/decoder in C99, with SIMD acceleration"
)

include(GNUInstallDirs)
include(CMakeDependentOption)
Expand Down Expand Up @@ -239,6 +242,10 @@ if (BASE64_BUILD_TESTS)
add_subdirectory(test)
endif()

########################################################################
# pkg-config file
configure_file("${CMAKE_CURRENT_LIST_DIR}/cmake/base64.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/base64.pc" @ONLY)

########################################################################
# base64
if (BASE64_BUILD_CLI)
Expand Down Expand Up @@ -280,6 +287,10 @@ install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/base64-config-version.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/base64.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
)

install(EXPORT base64-targets
NAMESPACE aklomp::
Expand Down
10 changes: 10 additions & 0 deletions cmake/base64.pc.in
@@ -0,0 +1,10 @@
prefix="@CMAKE_INSTALL_PREFIX@"
exec_prefix="${prefix}"
libdir="${prefix}/lib"
includedir="${prefix}/include"

Name: @PROJECT_NAME@
Description: @CMAKE_PROJECT_DESCRIPTION@
Version: @PROJECT_VERSION@
Cflags: -I${includedir}
Libs: -L${libdir} -l@PROJECT_NAME@

0 comments on commit 86a0d2b

Please sign in to comment.