Fix usr-move workaround in the presence of multi-arch.

The cmake directory may not be $PREFIX/lib/cmake, but
instead $PREFIX/lib/<arch>/cmake. Getting the PATH of such a
directory will not lead us to $PREFIX/, but to $PREFIX/lib.

Use a relative calculation instead.

Task-number: QTBUG-33223

Change-Id: Ice4e0f859ab1df238bad4eb942f073e84dd86cc3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This commit is contained in:
Stephen Kelly 2013-08-30 16:09:06 +02:00 committed by The Qt Project
parent 21fd5baf80
commit 018c4850c9
2 changed files with 3 additions and 3 deletions

View File

@ -50,10 +50,10 @@ contains(CMAKE_LIB_DIR,"^\\.\\./.*") {
CMAKE_LIB_DIR = $$[QT_INSTALL_LIBS]/
CMAKE_LIB_DIR_IS_ABSOLUTE = True
} else {
CMAKE_RELATIVE_INSTALL_DIR = $$cmakeRelativePath($$[QT_INSTALL_PREFIX], $$[QT_INSTALL_LIBS])
CMAKE_RELATIVE_INSTALL_LIBS_DIR = $$cmakeRelativePath($$[QT_INSTALL_PREFIX], $$[QT_INSTALL_LIBS])
# We need to go up another two levels because the CMake files are
# installed in $${CMAKE_LIB_DIR}/cmake/Qt5$${CMAKE_MODULE_NAME}
CMAKE_RELATIVE_INSTALL_DIR = "$${CMAKE_RELATIVE_INSTALL_DIR}../../"
CMAKE_RELATIVE_INSTALL_DIR = "$${CMAKE_RELATIVE_INSTALL_LIBS_DIR}../../"
}
CMAKE_BIN_DIR = $$cmakeRelativePath($$[QT_HOST_BINS], $$[QT_INSTALL_PREFIX])

View File

@ -13,7 +13,7 @@ get_filename_component(_IMPORT_PREFIX \"${CMAKE_CURRENT_LIST_FILE}\" PATH)
get_filename_component(_realCurr \"${_IMPORT_PREFIX}\" REALPATH)
get_filename_component(_realOrig \"$$CMAKE_INSTALL_LIBS_DIR/cmake/Qt5$${CMAKE_MODULE_NAME}\" REALPATH)
if(_realCurr STREQUAL _realOrig)
get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$CMAKE_INSTALL_LIBS_DIR\" PATH)
get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$CMAKE_INSTALL_LIBS_DIR/$${CMAKE_RELATIVE_INSTALL_LIBS_DIR}\" ABSOLUTE)
else()
get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE)
endif()