Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[Qt6] How to set the result of QLibraryInfo::path(QLibraryInfo::*) in configure time?



  • Hello,
    I'm trying to build Qt in submodules under macOS with the help of homebrew. When I built qttools and qttranslations, I found the the result of QLibraryInfo::path(QLibraryInfo::TranslationsPath) in qttools is /usr/local/opt/qtbase/share/qt/translations, and qttools, qttranslations are built separately.

    Ignoring the dependencies, I configure qtbase use these cmake options:
    -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/qtbase/6.0.0
    -DINSTALL_ARCHDATADIR=share/qt
    -DINSTALL_DATADIR=share/qt
    -DINSTALL_MKSPECSDIR=share/qt/mkspecs
    -DINSTALL_PLUGINSDIR=share/qt/plugins
    -DINSTALL_DESCRIPTIONSDIR=share/qt/modules
    -DINSTALL_QMLDIR=share/qt/qml
    -DINSTALL_EXAMPLESDIR=share/qt/examples
    after brew link the translations folder is linked to /usr/local/share/qt/translations
    So is there any way to set QLibraryInfo::PrefixPath to /usr/local , not /usr/local/Cellar/qtbase/6.0.0 or /usr/local/opt/qtbase , and keep the CMAKE_INSTALL_PREFIX?(so that homebrew can manage the share folder)


Log in to reply