Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Variables in generic project
Forum Updated to NodeBB v4.3 + New Features

Variables in generic project

Scheduled Pinned Locked Moved Qt Creator and other tools
3 Posts 2 Posters 1.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lafrecciablu
    wrote on last edited by
    #1

    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:
    ${MY_ENV_VAR}/MyProject

    Any help would be appreciated. Thanks.

    René

    1 Reply Last reply
    0
    • C Offline
      C Offline
      compor
      wrote on last edited by
      #2

      hello,

      i'm not sure, if that is possible for the specific group of files.
      re-reading the "doc":http://qt-project.org/doc/qtcreator-2.6/creator-project-generic.html 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

      e.g.

      for project "foo"

      @
      #!/bin/bash

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

      etc

      @

      for project "bar"

      @
      #!/bin/bash

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

      etc

      @

      then you could have your generic script do smt like

      @
      #!/bin/bash

      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

      purposes as understood by the purposer will be misunderstood by others

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lafrecciablu
        wrote on last edited by
        #3

        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.

        Cheers

        René

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved