Reflect CMAKE_INSTALL_INCLUDEDIR in pkg-config

This commit is contained in:
Alexander Shpilkin 2022-05-19 17:49:16 +03:00
parent afb69071d5
commit 876880fb3f
No known key found for this signature in database
GPG Key ID: 55F6F5B75637BD38
2 changed files with 6 additions and 1 deletions

View File

@ -298,6 +298,11 @@ if(SPDLOG_INSTALL)
# ---------------------------------------------------------------------------------------
# Install pkg-config file
# ---------------------------------------------------------------------------------------
if (IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}")
set(PKG_CONFIG_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}")
else()
set(PKG_CONFIG_INCLUDEDIR "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
endif()
if (IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}")
set(PKG_CONFIG_LIBDIR "${CMAKE_INSTALL_LIBDIR}")
else()

View File

@ -1,6 +1,6 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
includedir=${prefix}/include
includedir=@PKG_CONFIG_INCLUDEDIR@
libdir=@PKG_CONFIG_LIBDIR@
Name: lib@PROJECT_NAME@