CMake: Install translations in PACKAGE MODE

This commit is contained in:
Nenderus 2024-09-09 09:34:59 +03:00 committed by Ty
parent 11caae46c1
commit 4963ea9b11
2 changed files with 4 additions and 1 deletions

View File

@ -118,8 +118,10 @@ void QtHost::InstallTranslator(QWidget* dialog_parent)
s_current_collator = QCollator(s_current_locale); s_current_collator = QCollator(s_current_locale);
// Install the base qt translation first. // Install the base qt translation first.
#ifdef __APPLE__ #if defined(__APPLE__)
const QString base_dir = QStringLiteral("%1/../Resources/translations").arg(qApp->applicationDirPath()); const QString base_dir = QStringLiteral("%1/../Resources/translations").arg(qApp->applicationDirPath());
#elif defined(PCSX2_APP_DATADIR)
const QString base_dir = QStringLiteral("%1/%2/translations").arg(qApp->applicationDirPath()).arg(PCSX2_APP_DATADIR);
#else #else
const QString base_dir = QStringLiteral("%1/translations").arg(qApp->applicationDirPath()); const QString base_dir = QStringLiteral("%1/translations").arg(qApp->applicationDirPath());
#endif #endif

View File

@ -1289,6 +1289,7 @@ function(setup_main_executable target)
if (PACKAGE_MODE) if (PACKAGE_MODE)
install(TARGETS pcsx2-qt DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}) install(TARGETS pcsx2-qt DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
install(DIRECTORY ${CMAKE_SOURCE_DIR}/bin/resources DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/PCSX2) install(DIRECTORY ${CMAKE_SOURCE_DIR}/bin/resources DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/PCSX2)
install(DIRECTORY ${CMAKE_BINARY_DIR}/bin/translations DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/PCSX2)
else() else()
install(TARGETS pcsx2-qt DESTINATION ${CMAKE_SOURCE_DIR}/bin) install(TARGETS pcsx2-qt DESTINATION ${CMAKE_SOURCE_DIR}/bin)
endif() endif()