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

Vincent Hui vincenthk007 at gmail.com
Fri Jul 5 16:49:07 CEST 2019

Hi Richard,

Thank you for your reply,

Sorry, I am not a cmake expert. I cannot explain what CMakeCache.txt is
used for. What I can tell is that cmake users either edit CMakeCache.txt
directly to change values of options or use CMake GUI to build a project in
interactive mode, I am thinking whether we need qbs GUI in order to  let
users build a project in interactive mode.

Why GUI is needed to let users build projects in interactive mode in cmake.
" Using CMake to build a project in non-interactive mode is a simple
process if the project does not have many options. For larger projects like
VTK, using ccmake, cmake -i, or CMakeSetup is recommended. This is because
as you change options in the CMakeCache.txt file, cmake may add new entries
to that file. It can be difficult to know when to stop the run cmake, edit
the cache file cycle without the aid of an interface."


On Fri, 5 Jul 2019 at 22:06, Richard Weickelt <richard at weickelt.de> wrote:

> >> 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
> _______________________________________________
> Qbs mailing list
> Qbs at qt-project.org
> https://lists.qt-project.org/listinfo/qbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20190705/8bee7f76/attachment.html>

More information about the Qbs mailing list