From cab061ba56f794c917f551656e96d84d2cde6632 Mon Sep 17 00:00:00 2001 From: Peter Lama Date: Mon, 26 Mar 2018 12:58:47 -0700 Subject: [PATCH] Add Qt Assistant to mac app --- src/Gui/Assistant.cpp | 7 +++---- src/MacAppBundle/CMakeLists.txt | 3 +++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Gui/Assistant.cpp b/src/Gui/Assistant.cpp index afe1f367b5..767295857b 100644 --- a/src/Gui/Assistant.cpp +++ b/src/Gui/Assistant.cpp @@ -30,6 +30,7 @@ # include # include # include +# include #endif #include "Assistant.h" @@ -86,14 +87,12 @@ bool Assistant::startAssistant() QString app; app = QDir::toNativeSeparators(QString::fromUtf8 (App::GetApplication().getHomePath()) + QLatin1String("bin/")); +#elif defined(Q_OS_MAC) + QString app = QCoreApplication::applicationDirPath() + QDir::separator(); #else QString app = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QDir::separator(); #endif -#if !defined(Q_OS_MAC) app += QLatin1String("assistant"); -#else - app += QLatin1String("Assistant.app/Contents/MacOS/Assistant"); -#endif // get the name of the executable and the doc path QString exe = QString::fromUtf8(App::GetApplication().getExecutableName()); diff --git a/src/MacAppBundle/CMakeLists.txt b/src/MacAppBundle/CMakeLists.txt index 8be2dcfd9e..91a56866ad 100644 --- a/src/MacAppBundle/CMakeLists.txt +++ b/src/MacAppBundle/CMakeLists.txt @@ -57,6 +57,9 @@ if(BUILD_QT5) string(STRIP ${XCODE_PATH} XCODE_PATH) set(XCTEST_PATH "${XCODE_PATH}/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Versions/Current") + + # add qt assistant to bundle + install(PROGRAMS "${Qt5Core_DIR}/../../../libexec/Assistant.app/Contents/MacOS/Assistant" DESTINATION ${CMAKE_INSTALL_PREFIX}/MacOS) endif(BUILD_QT5) # Ensure the actual plugin files are installed instead of symlinks.