Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to define a reusable folder path in Qt project file?
Forum Updated to NodeBB v4.3 + New Features

How to define a reusable folder path in Qt project file?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 310 Views
  • 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.
  • O Offline
    O Offline
    OlePeterman
    wrote on last edited by
    #1

    When working with a Qt project file *.pro one can use for example the $$PWD to reference to the folder containing the project file.

    Is there a possible way to define a custom folder path?

    Like saying: $$CUSTOMFOLDER = /home/user/folder

    I would like to define CUSTOMFOLDER once and then reuse it in the project file so that I dont always have to paste the long folder path. By That the code would also become more readable.

    1 Reply Last reply
    0
    • JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by JoeCFD
      #2

      @OlePeterman said in How to define a reusable folder path in Qt project file?:

      CUSTOMFOLDER = /home/user/folder

      on LInux
      export CUSTOMFOLDER = /home/user/folder
      and save it in your .bashrc file

      1 Reply Last reply
      0
      • O Offline
        O Offline
        OlePeterman
        wrote on last edited by OlePeterman
        #3

        @JoeCFD appreciate your help

        Simply writing - like defining - in project file:
        CUSTOMFOLDER = /home/user/folder

        and the reusing that variable by:
        $$CUSTOMFOLDER

        returns the path reference.

        1 Reply Last reply
        2

        • Login

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