From 657297df383ea0684d886e7822f70fded705ab5a Mon Sep 17 00:00:00 2001 From: Alexandru Croitor <alexandru.croitor@qt.io> Date: Wed, 9 Feb 2022 17:03:27 +0100 Subject: [PATCH] WIP: Adjustments for testing deploy support --- CMakeLists.txt | 26 ++++++++++++++------------ main.cpp | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c19d92..7e71d69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,23 +22,25 @@ target_link_libraries(application ) qt_generate_deploy_qml_app_script( + NO_UNSUPPORTED_PLATFORM_ERROR + DEPLOY_USER_QML_MODULES_ON_UNSUPPORTED_PLATFORM TARGET application FILENAME_VARIABLE deploy_script MACOS_BUNDLE_POST_BUILD ) -if(APPLE) +#if(APPLE) install(TARGETS application BUNDLE DESTINATION .) install(TARGETS ellipseShape LIBRARY DESTINATION application.app/Contents/Frameworks) install(SCRIPT ${deploy_script}) -elseif(WIN32) - install(TARGETS application ellipseShape RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - install(SCRIPT ${deploy_script}) -else() - install(TARGETS application ellipseShape) - install(SCRIPT ${deploy_script}) - # No Qt deploy runtime dependencies support, so we have to install all our - # own plugins so that their installed RPATH is set appropriately and it - # needs to be after the above deploy script - install(TARGETS ellipseShapeplugin LIBRARY DESTINATION qml/Shapes/EllipseShape) -endif() +#elseif(WIN32) + #install(TARGETS application ellipseShape RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #install(SCRIPT ${deploy_script}) +#else() + #install(TARGETS application ellipseShape) + #install(SCRIPT ${deploy_script}) + ## No Qt deploy runtime dependencies support, so we have to install all our + ## own plugins so that their installed RPATH is set appropriately and it + ## needs to be after the above deploy script + #install(TARGETS ellipseShapeplugin LIBRARY DESTINATION qml/Shapes/EllipseShape) +#endif() diff --git a/main.cpp b/main.cpp index cba02ee..3f5054d 100644 --- a/main.cpp +++ b/main.cpp @@ -10,7 +10,7 @@ int main(int argc, char *argv[]) #ifdef Q_OS_OSX // Only needed when building an app bundle on macOS and we are using // shared libraries - engine.addImportPath(app.applicationDirPath() + "/../Resources/qml"); + //engine.addImportPath(app.applicationDirPath() + "/../Resources/qml"); #else // Installed applications typically put the executable in "bin" and the // QML modules under "qml". If there's no qt.conf file to tell us to look -- GitLab