// Copyright (C) 2016 BlackBerry Limited. All rights reserved. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #include "qnxrunconfiguration.h" #include "qnxconstants.h" #include "qnxtr.h" #include #include #include #include #include #include #include #include using namespace ProjectExplorer; using namespace RemoteLinux; using namespace Utils; namespace Qnx::Internal { class QnxRunConfiguration final : public RunConfiguration { public: QnxRunConfiguration(BuildConfiguration *bc, Id id) : RunConfiguration(bc, id) { executable.setDeviceSelector(kit(), ExecutableAspect::RunDevice); executable.setLabelText(Tr::tr("Executable on device:")); executable.setPlaceHolderText(Tr::tr("Remote path not set")); executable.makeOverridable("RemoteLinux.RunConfig.AlternateRemoteExecutable", "RemoteLinux.RunConfig.UseAlternateRemoteExecutable"); executable.setHistoryCompleter("RemoteLinux.AlternateExecutable.History"); symbolFile.setLabelText(Tr::tr("Executable on host:")); environment.setDeviceSelector(kit(), EnvironmentAspect::RunDevice); workingDir.setEnvironment(&environment); qtLibraries.setSettingsKey("Qt4ProjectManager.QnxRunConfiguration.QtLibPath"); qtLibraries.setLabelText(Tr::tr("Path to Qt libraries on device")); qtLibraries.setDisplayStyle(StringAspect::LineEditDisplay); setUpdater([this] { const BuildTargetInfo bti = buildTargetInfo(); const FilePath localExecutable = bti.targetFilePath; const DeployableFile depFile = buildSystem()->deploymentData() .deployableForLocalFile(localExecutable); executable.setExecutable(FilePath::fromString(depFile.remoteFilePath())); symbolFile.setValue(localExecutable); }); setRunnableModifier([this](ProcessRunData &r) { QString libPath = qtLibraries(); if (!libPath.isEmpty()) { r.environment.prependOrSet("LD_LIBRARY_PATH", libPath + "/lib"); r.environment.prependOrSet("QML_IMPORT_PATH", libPath + "/imports"); r.environment.prependOrSet("QML2_IMPORT_PATH", libPath + "/qml"); r.environment.prependOrSet("QT_PLUGIN_PATH", libPath + "/plugins"); r.environment.set("QT_QPA_FONTDIR", libPath + "/lib/fonts"); } }); } ExecutableAspect executable{this}; SymbolFileAspect symbolFile{this}; RemoteLinuxEnvironmentAspect environment{this}; ArgumentsAspect arguments{this}; WorkingDirectoryAspect workingDir{this}; TerminalAspect terminal{this}; StringAspect qtLibraries{this}; }; // QnxRunConfigurationFactory class QnxRunConfigurationFactory final : public ProjectExplorer::RunConfigurationFactory { public: QnxRunConfigurationFactory() { registerRunConfiguration(Constants::QNX_RUNCONFIG_ID); addSupportedTargetDeviceType(Constants::QNX_QNX_OS_TYPE); } }; void setupQnxRunnning() { static QnxRunConfigurationFactory theQnxRunConfigurationFactory; static ProcessRunnerFactory theQnxRunWorkerFactory({Constants::QNX_RUNCONFIG_ID}); } } // Qnx::Internal