Fix DESTDIR support on Windows for versioned hard-links
On Windows, we need to strip drive letter and colon before prepending DESTDIR when creating our versioned hard links. This fixes CI submodule updates. Change-Id: I41bc5f27b714ef74d3fadc4a0fb16c3d8b20da1a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 88886f193230292f38987ac4f1503753f50786f0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
f64ccc5f53
commit
f584356eef
@ -136,11 +136,23 @@ function(qt_internal_install_versioned_link install_dir target)
|
|||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
qt_path_join(install_base_file_path "$ENV\{DESTDIR}$\{CMAKE_INSTALL_PREFIX}"
|
qt_path_join(install_base_file_path "$\{qt_full_install_prefix}"
|
||||||
"${install_dir}" "$<TARGET_FILE_BASE_NAME:${target}>")
|
"${install_dir}" "$<TARGET_FILE_BASE_NAME:${target}>")
|
||||||
set(original "${install_base_file_path}$<TARGET_FILE_SUFFIX:${target}>")
|
set(original "${install_base_file_path}$<TARGET_FILE_SUFFIX:${target}>")
|
||||||
set(linkname "${install_base_file_path}${PROJECT_VERSION_MAJOR}$<TARGET_FILE_SUFFIX:${target}>")
|
set(linkname "${install_base_file_path}${PROJECT_VERSION_MAJOR}$<TARGET_FILE_SUFFIX:${target}>")
|
||||||
set(code
|
set(code "set(qt_full_install_prefix \"$\{CMAKE_INSTALL_PREFIX}\")"
|
||||||
|
" if(NOT \"$ENV\{DESTDIR}\" STREQUAL \"\")"
|
||||||
|
)
|
||||||
|
if(CMAKE_HOST_WIN32)
|
||||||
|
list(APPEND code
|
||||||
|
" if(qt_full_install_prefix MATCHES \"^[a-zA-Z]:\")"
|
||||||
|
" string(SUBSTRING \"$\{qt_full_install_prefix}\" 2 -1 qt_full_install_prefix)"
|
||||||
|
" endif()"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
list(APPEND code
|
||||||
|
" string(PREPEND qt_full_install_prefix \"$ENV\{DESTDIR}\")"
|
||||||
|
" endif()"
|
||||||
" message(STATUS \"Creating hard link ${original} -> ${linkname}\")"
|
" message(STATUS \"Creating hard link ${original} -> ${linkname}\")"
|
||||||
" file(CREATE_LINK \"${original}\" \"${linkname}\" COPY_ON_ERROR)")
|
" file(CREATE_LINK \"${original}\" \"${linkname}\" COPY_ON_ERROR)")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user