[Qbs] Is there a feature similar with cmake option?

Richard Weickelt richard at weickelt.de
Fri Jul 5 16:06:28 CEST 2019


>> Cmake options can be overridden by CMakeCache.txt files inside build
>> folders. Is there similar feature in qbs?
> 
> No, and it sounds like a horrible idea.

Regardless of the CMake inherent beauty. If you (Victor) want to have a
profound answer to your question, you should explain what CMakeCache.txt is
used for. It would be also helpful if you come up with an understandable
example of your use-case.

I found this explanation:
https://stackoverflow.com/questions/42160117/what-is-cmakecache-txt-and-why-it-overrides-my-variables

And it sounds like CMakeCache.txt is used to prevent from typing a CMake
command line with looooots of -D. Is that correct? There is no direct
equivalent in Qbs.

You can override project, product and module options on command line:
https://doc-snapshots.qt.io/qbs/cli-build.html#parameters

Nothing stops you from putting your custom overrides into a text file and
then insert them right in place:

# options.txt
modules.cpp.optimization:fast project.myCoolFeatureEnabled:true

# my-qbs-invocation-script.sh
qbs build $(cat options.txt)

Richard


More information about the Qbs mailing list