CMake: generate and install the tinycbor.pc pkgconfig file

Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Thiago Macieira
2026-02-18 09:25:07 -08:00
parent e96a3fb456
commit 1bbc17b02f
2 changed files with 12 additions and 5 deletions
+7
View File
@@ -125,6 +125,9 @@ generate_export_header(tinycbor
# Generate version header
configure_file(src/tinycbor-version.h.in tinycbor-version.h)
# Generate pkgconfig file
configure_file(tinycbor.pc.in tinycbor.pc @ONLY)
# Check for open_memstream and store the result in HAVE_OPEN_MEMSTREAM
check_symbol_exists(open_memstream stdio.h HAVE_OPEN_MEMSTREAM)
check_symbol_exists(funopen stdio.h HAVE_OPEN_FUNOPEN)
@@ -157,6 +160,10 @@ install(FILES
${PROJECT_BINARY_DIR}/tinycbor-export.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tinycbor
)
install(FILES
${CMAKE_BINARY_DIR}/tinycbor.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
install(
TARGETS tinycbor
EXPORT "${TARGETS_EXPORT_NAME}"
+5 -5
View File
@@ -1,11 +1,11 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
libdir=@CMAKE_INSTALL_LIBDIR@
includedir=@CMAKE_INSTALL_INCLUDEDIR@
Name: TinyCBOR
Description: A tiny CBOR encoder and decoder library
Version: @version@
Version: @PROJECT_VERSION@
Libs: -L${libdir} -ltinycbor
Libs.private: -lm
Cflags: -I${includedir}/tinycbor