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@