mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-22 06:35:42 +02:00
Don't add / to start of pkg-config file path when DESTDIR is unset
This broke installation on Windows, because the suddenly started with a '/' instead of a drive letter. Closes #3019
This commit is contained in:
@@ -195,17 +195,23 @@ if(NOT_SUBPROJECT)
|
|||||||
"set(include_dir \"${CMAKE_INSTALL_INCLUDEDIR}\")"
|
"set(include_dir \"${CMAKE_INSTALL_INCLUDEDIR}\")"
|
||||||
"set(lib_dir \"${CMAKE_INSTALL_LIBDIR}\")"
|
"set(lib_dir \"${CMAKE_INSTALL_LIBDIR}\")"
|
||||||
[[
|
[[
|
||||||
|
message(STATUS "DESTDIR: $ENV{DESTDIR}")
|
||||||
|
set(DESTDIR_PREFIX "")
|
||||||
|
if (DEFINED ENV{DESTDIR})
|
||||||
|
set(DESTDIR_PREFIX "$ENV{DESTDIR}")
|
||||||
|
endif ()
|
||||||
|
message(STATUS "PREFIX: ${DESTDIR_PREFIX}")
|
||||||
set(lib_name "$<TARGET_FILE_BASE_NAME:Catch2>")
|
set(lib_name "$<TARGET_FILE_BASE_NAME:Catch2>")
|
||||||
configure_file(
|
configure_file(
|
||||||
"${impl_pc_file}"
|
"${impl_pc_file}"
|
||||||
"$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/${install_pkgconfdir}/catch2.pc"
|
"${DESTDIR_PREFIX}${CMAKE_INSTALL_PREFIX}/${install_pkgconfdir}/catch2.pc"
|
||||||
@ONLY
|
@ONLY
|
||||||
)
|
)
|
||||||
|
|
||||||
set(lib_name "$<TARGET_FILE_BASE_NAME:Catch2WithMain>")
|
set(lib_name "$<TARGET_FILE_BASE_NAME:Catch2WithMain>")
|
||||||
configure_file(
|
configure_file(
|
||||||
"${main_pc_file}"
|
"${main_pc_file}"
|
||||||
"$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/${install_pkgconfdir}/catch2-with-main.pc"
|
"${DESTDIR_PREFIX}${CMAKE_INSTALL_PREFIX}/${install_pkgconfdir}/catch2-with-main.pc"
|
||||||
@ONLY
|
@ONLY
|
||||||
)
|
)
|
||||||
]]
|
]]
|
||||||
|
Reference in New Issue
Block a user