Skip to content

Commit 7cad6d7

Browse files
committed
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
1 parent 644821c commit 7cad6d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,14 @@ if(NOT_SUBPROJECT)
198198
set(lib_name "$<TARGET_FILE_BASE_NAME:Catch2>")
199199
configure_file(
200200
"${impl_pc_file}"
201-
"${CMAKE_INSTALL_PREFIX}/${install_pkgconfdir}/catch2.pc"
201+
"$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/${install_pkgconfdir}/catch2.pc"
202202
@ONLY
203203
)
204204

205205
set(lib_name "$<TARGET_FILE_BASE_NAME:Catch2WithMain>")
206206
configure_file(
207207
"${main_pc_file}"
208-
"${CMAKE_INSTALL_PREFIX}/${install_pkgconfdir}/catch2-with-main.pc"
208+
"$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/${install_pkgconfdir}/catch2-with-main.pc"
209209
@ONLY
210210
)
211211
]]

0 commit comments

Comments
 (0)