Skip to content

Commit

Permalink
added support for extra qt install dir
Browse files Browse the repository at this point in the history
  • Loading branch information
arBmind committed Mar 1, 2024
1 parent a5b470f commit 266d4de
Showing 1 changed file with 54 additions and 8 deletions.
62 changes: 54 additions & 8 deletions cmake/QbsBuildConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ file(RELATIVE_PATH QBS_RELATIVE_LIBEXEC_RPATH "/${QBS_LIBEXEC_INSTALL_DIR}" "/${
file(RELATIVE_PATH QBS_RELATIVE_APP_RPATH "/${QBS_APP_INSTALL_DIR}" "/${QBS_LIB_INSTALL_DIR}")
file(RELATIVE_PATH QBS_RELATIVE_PLUGINS_RPATH "/${QBS_PLUGINS_INSTALL_DIR}" "/${QBS_LIB_INSTALL_DIR}")

set(QBS_QT_INSTALL_DIR "${QBS_LIB_INSTALL_DIR}" CACHE STRING "Relative install location for Qt libraries.")
file(RELATIVE_PATH QBS_QT_RELATIVE_LIB_RPATH "/${QBS_LIB_INSTALL_DIR}" "/${QBS_QT_INSTALL_DIR}")
file(RELATIVE_PATH QBS_QT_RELATIVE_LIBEXEC_RPATH "/${QBS_LIBEXEC_INSTALL_DIR}" "/${QBS_QT_INSTALL_DIR}")
file(RELATIVE_PATH QBS_QT_RELATIVE_APP_RPATH "/${QBS_APP_INSTALL_DIR}" "/${QBS_QT_INSTALL_DIR}")
file(RELATIVE_PATH QBS_QT_RELATIVE_PLUGINS_RPATH "/${QBS_PLUGINS_INSTALL_DIR}" "/${QBS_QT_INSTALL_DIR}")

if(WIN32 OR NOT QBS_ENABLE_RPATH)
set(QBS_MACOSX_RPATH OFF)
set(QBS_LIB_RPATH "")
Expand All @@ -44,16 +50,56 @@ if(WIN32 OR NOT QBS_ENABLE_RPATH)
set(QBS_PLUGINS_RPATH "")
elseif(APPLE)
set(QBS_MACOSX_RPATH ON)
set(QBS_LIB_RPATH "@loader_path")
set(QBS_LIBEXEC_RPATH "@loader_path/${QBS_RELATIVE_LIBEXEC_RPATH}")
set(QBS_APP_RPATH "@loader_path/${QBS_RELATIVE_APP_RPATH}")
set(QBS_PLUGINS_RPATH "@loader_path/${QBS_RELATIVE_PLUGINS_RPATH}")

if("${QBS_LIB_INSTALL_DIR}" STREQUAL "${QBS_QT_INSTALL_DIR}")
set(QBS_LIB_RPATH "@loader_path")
else()
set(QBS_LIB_RPATH "@loader_path:@loader_path/${QBS_QT_RELATIVE_LIB_RPATH}")
endif()

if("${QBS_RELATIVE_LIBEXEC_RPATH}" STREQUAL "${QBS_QT_RELATIVE_LIBEXEC_RPATH}")
set(QBS_LIBEXEC_RPATH "@loader_path/${QBS_RELATIVE_LIBEXEC_RPATH}")
else()
set(QBS_LIBEXEC_RPATH "@loader_path/${QBS_RELATIVE_LIBEXEC_RPATH}:@loader_path/${QBS_QT_RELATIVE_LIBEXEC_RPATH}")
endif()

if("${QBS_RELATIVE_APP_RPATH}" STREQUAL "${QBS_QT_RELATIVE_APP_RPATH}")
set(QBS_APP_RPATH "@loader_path/${QBS_RELATIVE_APP_RPATH}")
else()
set(QBS_APP_RPATH "@loader_path/${QBS_RELATIVE_APP_RPATH}:@loader_path/${QBS_QT_RELATIVE_APP_RPATH}")
endif()

if("${QBS_RELATIVE_PLUGINS_RPATH}" STREQUAL "${QBS_QT_RELATIVE_PLUGINS_RPATH}")
set(QBS_PLUGINS_RPATH "@loader_path/${QBS_RELATIVE_PLUGINS_RPATH}")
else()
set(QBS_PLUGINS_RPATH "@loader_path/${QBS_RELATIVE_PLUGINS_RPATH}:@loader_path/${QBS_QT_RELATIVE_PLUGINS_RPATH}")
endif()
else()
set(QBS_MACOSX_RPATH OFF)
set(QBS_LIB_RPATH "\$ORIGIN")
set(QBS_LIBEXEC_RPATH "\$ORIGIN/${QBS_RELATIVE_LIBEXEC_RPATH}")
set(QBS_APP_RPATH "\$ORIGIN/${QBS_RELATIVE_APP_RPATH}")
set(QBS_PLUGINS_RPATH "\$ORIGIN/${QBS_RELATIVE_PLUGINS_RPATH}")

if("${QBS_LIB_INSTALL_DIR}" STREQUAL "${QBS_QT_INSTALL_DIR}")
set(QBS_LIB_RPATH "\$ORIGIN")
else()
set(QBS_LIB_RPATH "\$ORIGIN:\$ORIGIN/${QBS_QT_RELATIVE_LIB_RPATH}")
endif()

if("${QBS_RELATIVE_LIBEXEC_RPATH}" STREQUAL "${QBS_QT_RELATIVE_LIBEXEC_RPATH}")
set(QBS_LIBEXEC_RPATH "\$ORIGIN/${QBS_RELATIVE_LIBEXEC_RPATH}:\$ORIGIN/${QBS_QT_RELATIVE_LIBEXEC_RPATH}")
else()
set(QBS_LIBEXEC_RPATH "\$ORIGIN/${QBS_RELATIVE_LIBEXEC_RPATH}:\$ORIGIN/${QBS_QT_RELATIVE_LIBEXEC_RPATH}")
endif()

if("${QBS_RELATIVE_APP_RPATH}" STREQUAL "${QBS_QT_RELATIVE_APP_RPATH}")
set(QBS_APP_RPATH "\$ORIGIN/${QBS_RELATIVE_APP_RPATH}")
else()
set(QBS_APP_RPATH "\$ORIGIN/${QBS_RELATIVE_APP_RPATH}:\$ORIGIN/${QBS_QT_RELATIVE_APP_RPATH}")
endif()

if("${QBS_RELATIVE_PLUGINS_RPATH}" STREQUAL "${QBS_QT_RELATIVE_PLUGINS_RPATH}")
set(QBS_PLUGINS_RPATH "\$ORIGIN/${QBS_RELATIVE_PLUGINS_RPATH}")
else()
set(QBS_PLUGINS_RPATH "\$ORIGIN/${QBS_RELATIVE_PLUGINS_RPATH}:\$ORIGIN/${QBS_QT_RELATIVE_PLUGINS_RPATH}")
endif()
endif()

function(get_update_path_command var)
Expand Down

0 comments on commit 266d4de

Please sign in to comment.