From 876880fb3f0791d0e1571f207ff9d991ae71b3b0 Mon Sep 17 00:00:00 2001 From: Alexander Shpilkin Date: Thu, 19 May 2022 17:49:16 +0300 Subject: [PATCH] Reflect CMAKE_INSTALL_INCLUDEDIR in pkg-config --- CMakeLists.txt | 5 +++++ cmake/spdlog.pc.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e733345..f3edf3af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/cmake/spdlog.pc.in b/cmake/spdlog.pc.in index f3a56439..ffab5d6f 100644 --- a/cmake/spdlog.pc.in +++ b/cmake/spdlog.pc.in @@ -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@