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. Configuring a QMake project - custom variables with paths to libraries
Forum Updated to NodeBB v4.3 + New Features

Configuring a QMake project - custom variables with paths to libraries

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
2 Posts 2 Posters 335 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.
  • I Offline
    I Offline
    IanShade
    wrote on last edited by
    #1

    Hello
    My project uses some third party libraries that can reside anywhere, in a location not relative to project directory. Currently I add them in my .pro file with hardcoded absolute paths like this:

    INCLUDEPATH += 'C:\Program Files\Somelibrary\Include'
    

    This is fine as long as I'm the only one working on the project. However I'd like to let other developers clone, build and commit to my repository. What is the best way to let them configure the project and specify paths where they placed these libraries, without them having to modify the .pro file?

    I had two ideas:

    • using a .pri file what would contain all paths as variables and would not be tracked by version control, so that every developer could have his own paths there
    • using properties as here

    I was unable to find any public projects that would use either of these methods and I couldn't find any descriptions of a correct way to do this. So I'd like to ask you guys for help.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You can do that up to a point. If you have 10 dependencies that everybody can put anywhere they wish, you won't be able to have a generic solution.

      What could be done is the documentation of a preferred structure for the dependencies to be stored in and then use for example an environment variable that points to the root folder of these dependencies. IIRC, CUDA is using something like that on Windows at least.

      The pri file solution that you suggest could take advantage of that for example.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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