Variables in generic project

  • Hi,

    I know how to define and use variables in qmake projects (.pro).
    I can't seem to find a way to do it in a generic project (made of .config, .creator, .files, .includes).
    Typically I'd like to use an environment or Qt variable for a part of the path when listing project files in .files and include paths in .includes.

    Something like for .includes:

    Any help would be appreciated. Thanks.


  • hello,

    i'm not sure, if that is possible for the specific group of files.
    re-reading the "doc": doesn't provide any clue to that direction.

    however, it gives an example of automating the creation of the .files using git.

    you could generate the literal values for the contents of those files using a generic bash script and a per project script that would just expose those values to the generic script's environment


    for project "foo"


    export PRJ_NAME=foo
    export PRJ_HDR_DIR=foo/include
    export DB_HDR_DIR=foo/db/include



    for project "bar"


    export PRJ_NAME=bar
    export PRJ_HDR_DIR=bar/include
    export DB_HDR_DIR=bar/db/include



    then you could have your generic script do smt like


    echo ${PRJ_HDR_DIR} >> ${PRJ_NAME}.includes
    echo ${DB_HDR_DIR} >> ${PRJ_NAME}.includes

    it's kinda hard to suggest a specific solution tailored to your needs.
    hope this helps

  • Hello Compor,

    Thanks for your suggestions.

    Writing a script is what I ended up to.
    The scripts generates .files and .includes (based on .files + default ones).
    The other ones are copies of "templates" (.creator, .config, .creator.user).

    It's true that generic projects are not well documented. For example what's the syntax of .config and .creator? Could I define variables in there?

    For the records I use QtCreator for editing APEX/Summit code, which enforces a hierarchy of the type <MySubSystem>/<MySubSystem>.<MyView> (a sub system being a project). Yeah, I know it's weird.



Log in to reply

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