[Qt-creator] Set build environment variable from Qt Creator variable

Andrzej Telszewski andrzej at telszewski.com
Thu Feb 26 19:00:30 CET 2026


On 25/02/2026 10:46, Christian Kandeler via Qt-creator wrote:
> On 2/24/26 6:51 PM, Andrzej Telszewski wrote:
>> On 10/02/2026 10:49, Christian Kandeler via Qt-creator wrote:
>>> On 2/10/26 10:19 AM, Andrzej Telszewski wrote:
>>>> how can I use QtC's variables expansion to set an environment 
>>>> variable (e.g. in build environment)?
>>> There is currently no support for macro expansion in most 
>>> environment widgets.
>>> Feel free to file a feature request at bugreports.qt.io.
>>>
>>
>> Did the first step and registered to the bugreports ;)
>>
>> Anyways, I'll still want to ask: is there _any_ way to set build 
>> environment variable,
>> that could somehow contain project's root directory - not hardcoded, 
>> but derived?
>>
>> My use case is for *.shared project files.
>> When creating such shared project file, I use the likes of macro 
>> expansion,
>> so that the shared file does not contain any hardcoded paths, and works
>> no matter in which location I checkout my source code.
>
> I don't think so. However: Isn't this something you should rather do 
> in your project file? Surely your build system provides you with the 
> project directory and allows you to set environment variables?

My wish would be not to modify the build system, but actually that might 
be the best option.
It's CMake, so that's no-brainer.

Thanks!



More information about the Qt-creator mailing list