Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Handle DESTDIR env var when generating pkgconfig files

Having the ability to configure the installation path at config
time, and the ability to change the prefix at install time is not
enough, apparently people also use env var to redirect them instead.

Closes #3006
Commit
7cad6d75390668ad2b6bec8432a2e408a992e1bf
Author
Martin Hořeňovský ·
Parents
644821ce28cb

Files · Download .tar.gz

Changes

 CMakeLists.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4b4e4f58..33377f5d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -198,14 +198,14 @@ if(NOT_SUBPROJECT)
          set(lib_name "$<TARGET_FILE_BASE_NAME:Catch2>")
          configure_file(
            "${impl_pc_file}"
-           "${CMAKE_INSTALL_PREFIX}/${install_pkgconfdir}/catch2.pc"
+           "$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/${install_pkgconfdir}/catch2.pc"
            @ONLY
          )
 
          set(lib_name "$<TARGET_FILE_BASE_NAME:Catch2WithMain>")
          configure_file(
            "${main_pc_file}"
-           "${CMAKE_INSTALL_PREFIX}/${install_pkgconfdir}/catch2-with-main.pc"
+           "$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/${install_pkgconfdir}/catch2-with-main.pc"
            @ONLY
          )
        ]]