2019-09-13 01:07:22 +08:00
|
|
|
#Could probably be a vcpkg_fix_makefile_install for other ports?
|
|
|
|
function(qt_fix_makefile_install BUILD_DIR)
|
|
|
|
#Fix the installation location
|
2023-02-23 05:17:37 +08:00
|
|
|
set(MSYS_HACK "")
|
|
|
|
if(VCPKG_HOST_IS_WINDOWS)
|
|
|
|
file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}" NATIVE_INSTALLED_DIR)
|
|
|
|
file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" NATIVE_PACKAGES_DIR)
|
|
|
|
if(VCPKG_TARGET_IS_MINGW)
|
|
|
|
set(MSYS_HACK ":@msyshack@%=%")
|
|
|
|
file(STRINGS "${BUILD_DIR}/Makefile" using_sh REGEX "= rm -f")
|
|
|
|
if(using_sh)
|
|
|
|
set(NATIVE_INSTALLED_DIR "${CURRENT_INSTALLED_DIR}")
|
|
|
|
set(NATIVE_PACKAGES_DIR "${CURRENT_PACKAGES_DIR}")
|
|
|
|
endif()
|
|
|
|
endif()
|
2021-05-12 05:03:00 +08:00
|
|
|
string(SUBSTRING "${NATIVE_INSTALLED_DIR}" 0 2 INSTALLED_DRIVE)
|
|
|
|
string(SUBSTRING "${NATIVE_PACKAGES_DIR}" 0 2 PACKAGES_DRIVE)
|
2023-02-23 05:17:37 +08:00
|
|
|
string(SUBSTRING "${NATIVE_INSTALLED_DIR}" 2 -1 INSTALLED_DIR_WITHOUT_DRIVE)
|
|
|
|
string(SUBSTRING "${NATIVE_PACKAGES_DIR}" 2 -1 PACKAGES_DIR_WITHOUT_DRIVE)
|
2019-09-13 01:07:22 +08:00
|
|
|
else()
|
2023-02-23 05:17:37 +08:00
|
|
|
set(INSTALLED_DRIVE "")
|
|
|
|
set(PACKAGES_DRIVE "")
|
|
|
|
set(INSTALLED_DIR_WITHOUT_DRIVE "${CURRENT_INSTALLED_DIR}")
|
|
|
|
set(PACKAGES_DIR_WITHOUT_DRIVE "${CURRENT_PACKAGES_DIR}")
|
2019-09-13 01:07:22 +08:00
|
|
|
endif()
|
2023-02-23 05:17:37 +08:00
|
|
|
set(installed "${INSTALLED_DRIVE}$(INSTALL_ROOT${MSYS_HACK})${INSTALLED_DIR_WITHOUT_DRIVE}")
|
|
|
|
set(packages "${PACKAGES_DRIVE}$(INSTALL_ROOT${MSYS_HACK})${PACKAGES_DIR_WITHOUT_DRIVE}")
|
2019-09-13 01:07:22 +08:00
|
|
|
|
|
|
|
file(GLOB_RECURSE MAKEFILES "${BUILD_DIR}/*Makefile*")
|
|
|
|
foreach(MAKEFILE ${MAKEFILES})
|
2024-06-20 05:07:05 +08:00
|
|
|
vcpkg_replace_string("${MAKEFILE}" "${installed}" "${packages}" IGNORE_UNCHANGED)
|
2019-09-13 01:07:22 +08:00
|
|
|
endforeach()
|
2023-02-23 05:17:37 +08:00
|
|
|
endfunction()
|