Author: Luca Boccassi Forwarded: https://github.com/USNavalResearchLaboratory/norm/pull/23 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,6 +145,16 @@ install(FILES include/normApi.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +# Create pkg-config file norm.pc +# TODO: once waf is removed, norm.pc.in can be edited to use the variables CMake sets directly, and +# remove these re-definitions +set(VERSION ${PROJECT_VERSION}) +set(PREFIX ${CMAKE_INSTALL_PREFIX}) +set(LIBDIR ${CMAKE_INSTALL_LIBDIR}) +set(STATIC_LIBS "-lprotokit") +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/norm.pc.in ${CMAKE_CURRENT_BINARY_DIR}/norm.pc @ONLY) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/norm.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + # Create a ConfigVersion.cmake file include(CMakePackageConfigHelpers) write_basic_package_version_file( --- a/norm.pc.in +++ b/norm.pc.in @@ -1,6 +1,6 @@ prefix=@PREFIX@ exec_prefix=${prefix} -libdir=@LIBDIR@ +libdir=${prefix}/@LIBDIR@ includedir=${prefix}/include Name: norm @@ -8,4 +8,5 @@ Description: NACK-Oriented Reliable Multicast (NORM) library Libs: -L${libdir} -lnorm Libs.private: @STATIC_LIBS@ +Requires.private: @REQUIRES_PRIVATE@ Cflags: -I${includedir}