Use Qbs in similar way of using autoconf/autotools

  • Projects using autoconf/autotools can be built in three steps usually:

    $ ./configure --prefix=/usr --enable-something
    $ make
    $ make install

    Is it possible to use Qbs in same manner?
    Especially, I cannot figure out how to 'configure' Qbs project to specify customized build options.

  • Moderators

    Maybe I'm not fully understanding what you're asking but it seems like just running qbs would do the entire build. No need for a configure/make.

  • With autoconf/autotools, you can configure once and build(make) many times with same configurations.

    I know I can build a project by running qbs.
    Although it seems that I can set Qbs properties when running qbs, I have to specify all configurations whenever running qbs.

    So, what I need is the way to specify configurations only once not for every build.
    Configurations may contain install prefix, debug/release switch, some feature enabling, and etc.
    Is this possible with Qbs? Or, should I write some configuration file and read and apply it from qbs script file?

  • Moderators

    @xylosper Good question. I've never used QBS. Cmake is a good choice for cross platform builds and it is a configure once build many type system.

    Vastly superior to anything else I have used, but it takes a bit of learning to get into.

    It's become very popular over the years. Probably the best build system I've played with in the last 5 years.

  • @ambershark In fact, I've been used CMake a lot, but I will never get used to the syntax of CMake.
    Also, CMake is not a build system in fact, it's a generator which causes various problems when using it in IDE, especially, Qt Creator.
    For instance, it's quite unkind to create a new class in Qt Creator with CMake project.

    On the other hand, the syntax of Qbs is that of QML which I'm already used to.
    Furthermore it provides way better integration with Qt Creator.

    Anyway, if it's not possible, I can make configuration script to save settings and I'll parse it in Qbs script.

    Thank you.

  • Moderators

    @xylosper Yea cmake can have some issues with certain ides. Others are built for it. The new MSVC 2017 has some support for cmake natively. My favorite ide CLion by JetBrains is 100% based around cmake and integrates completely with it. For things like adding a class and all that type of stuff.

    But if cmake isn't for you that is fine too. :)

    I'm not saying there's no way to do it with qbs, just that I haven't used it. Once I found cmake it's hard to use anything else. It handles everything cross platform, and all my development is cross platform.

    Maybe someone else can add on to the qbs thing...

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.