diff --git a/CMakeLists.txt b/CMakeLists.txt index d6e87e50..414e77ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -352,7 +352,7 @@ if(SPDLOG_INSTALL) # --------------------------------------------------------------------------------------- # Include files # --------------------------------------------------------------------------------------- - install(DIRECTORY include/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" PATTERN "fmt/bundled" EXCLUDE) + install(DIRECTORY include/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") install( TARGETS spdlog fmt EXPORT spdlog @@ -373,10 +373,8 @@ if(SPDLOG_INSTALL) else() set(PKG_CONFIG_LIBDIR "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}") endif() - get_target_property(PKG_CONFIG_DEFINES spdlog INTERFACE_COMPILE_DEFINITIONS) - string(REPLACE ";" " -D" PKG_CONFIG_DEFINES "${PKG_CONFIG_DEFINES}") - string(CONCAT PKG_CONFIG_DEFINES "-D" "${PKG_CONFIG_DEFINES}") - configure_file("cmake/${PROJECT_NAME}.pc.in" "${pkg_config}" @ONLY) + configure_file("cmake/spdlog.pc.in" "${pkg_config}" @ONLY) + message(STATUS "Installing pkg-config ${pkg_config} in ${pkgconfig_install_dir}") install(FILES "${pkg_config}" DESTINATION "${pkgconfig_install_dir}") # --------------------------------------------------------------------------------------- diff --git a/cmake/spdlog.pc.in b/cmake/spdlog.pc.in index ffab5d6f..7ec33cee 100644 --- a/cmake/spdlog.pc.in +++ b/cmake/spdlog.pc.in @@ -1,13 +1,13 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix} -includedir=@PKG_CONFIG_INCLUDEDIR@ -libdir=@PKG_CONFIG_LIBDIR@ +libdir=${exec_prefix}/lib +includedir=${prefix}/include -Name: lib@PROJECT_NAME@ +Name: @PROJECT_NAME@ Description: Fast C++ logging library. -URL: https://github.com/gabime/@PROJECT_NAME@ -Version: @SPDLOG_VERSION@ -CFlags: -I${includedir} @PKG_CONFIG_DEFINES@ -Libs: -L${libdir} -lspdlog -pthread -Requires: @PKG_CONFIG_REQUIRES@ +URL: https://github.com/gabime/spdlog.git +Version: @PROJECT_VERSION@ +Requires: fmt +Libs: -L${libdir} -lspdlog +Cflags: -I${includedir}