Skip to content

Commit

Permalink
create pkgconfig file during build
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasgscofield authored and AzothAmmo committed Dec 24, 2024
1 parent 864c2fc commit cb6c6ac
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,22 @@ if(CEREAL_INSTALL)
else()
write_basic_package_version_file("${versionFile}" COMPATIBILITY SameMajorVersion)
endif()
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc.in
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc
@ONLY
)

install(FILES ${configFile} ${versionFile} DESTINATION ${configInstallDestination})
install(
EXPORT ${PROJECT_NAME}Targets
NAMESPACE "cereal::"
DESTINATION ${configInstallDestination}
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig
)
endif()


Expand Down
8 changes: 8 additions & 0 deletions cereal.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
prefix=@CMAKE_INSTALL_PREFIX@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@

Name: @PROJECT_NAME@
Description: cereal is a header-only C++11 serialization library
URL: https://uscilab.github.io/cereal/
Version: @PROJECT_VERSION@
Cflags: -I"${includedir}"

0 comments on commit cb6c6ac

Please sign in to comment.