Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
13 changes: 12 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prefix="@CMAKE_INSTALL_PREFIX@"
exec_prefix="${prefix}"
libdir="${prefix}/lib"
includedir="${prefix}/include"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't account for user configured CMAKE_INSTALL_INCLUDEDIR, CMAKE_INSTALL_LIBDIR (or CMAKE_INSTALL_BINDIR on Windows) variables.


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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, this doesn't account for CMAKE_(STATIC|SHARED|IMPORT)_LIBRARY_(PRE|SUF)FIX(_C)?. Please also note that the PROJECT_NAME <=> target name equivalence is rather coincidental.