diff --git a/CMakeLists.txt b/CMakeLists.txt index 87a408ab..75f0f59b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,6 +96,11 @@ 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( @@ -103,6 +108,10 @@ if(CEREAL_INSTALL) NAMESPACE "cereal::" DESTINATION ${configInstallDestination} ) + install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig + ) endif() diff --git a/cereal.pc.in b/cereal.pc.in new file mode 100644 index 00000000..5ee10f80 --- /dev/null +++ b/cereal.pc.in @@ -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}"