13

I am trying to configure the "Run Settings" on Qt Creator 3.0.1.

I would like to set the value of many environment variables by sourcing a shell script 'myScript'. However, Deployment's Custom Process Step apparently doesn't accept 'source' as a command.

If I execute the script instead of sourcing it, it sets the environment variables of the shell process in which it is executed, which is not the same where Qt Creator runs the executable.

Is it possible to use 'myScript' to configure the environment variables ? How should I call it?

3 Answers 3

1

Ofcorse, You can run qt via scrypt. This is very simply. My script is below. Ofcorse you need environment variables in concret file. In my case this file is environment-setup

#!/bin/bash echo "ustawienie zmiennej /usr/local/angstrom/arm/environment-setup" # set concret variables important is . / . /usr/local/angstrom/arm/environment-setup echo "Uruchomienie qtCreator" # lunched qtcreator $HOME/Qt/Tools/QtCreator/bin/qtcreator 

You also can set this script as linked to main icon qt in your start menu. After this, all you need to run qt is only click in your shortcut in menu

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for replying, but my question is about how to set environment variables once Qt Creator is already running. I would need that in order to have different "Run Settings" (inside Qt Creator) and switch easily from one to another.
0

I think currently there's no proper way to set QtCreator build environment variables using a script. For example in this guide by ICS three options are mentioned in the "Set Up the Environment" section:

1. You can always start Qt Creator in the same shell/console session where you previously ran the environment setup script (i.e. /opt/poky/2.2.1/environment-setup-armv5e-poky-linux-gnueabi). This option is the easiest, but means that you can’t simply launch Qt Creator from a desktop shortcut or similar method. It might also cause problems if you want to build for the desktop or another embedded platform within the same session. 2. You can add the environment variables to the kit’s settings. This option is a little more work to set up, but avoids the issues of the shell setup. 3. A third option is to add the environment variables to your project settings, but that means adding it to every project that uses the kit. 

Comments

0

A workaround would be to start QT Creator from the command line after sourcing the script that contains the necessary environment variables:

source path/to/myScript qtcreator 

This will load the environment variables declared in myScript into your current bash/zsh session, and then start QT Creator with all environment variables from the current bash/zsh session.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.