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. Change the run environment Path from .pro files
Forum Update on Monday, May 27th 2025

Change the run environment Path from .pro files

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 135 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.
  • M Offline
    M Offline
    Maluna34
    wrote on last edited by
    #1

    Hello,

    On one of my project on Windows, I need to update the run environment in QtCreator (screen) for two reasons:

    • Add path of one of my lib
    • Move up the path of another MinGW than the one provided with Qt

    But I need to do these changes manually for all unit test project! Is it possible to do it from the .pro files?
    And because of these changes, the switch between release and debug dependencies is not automatic anymore.

    1/- Add a path
    Let's suppose that we have an application C using lib B, with lib B using lib A:

    C -> B -> A
    

    In C.pro file, we'll have:

    win32 {
        CONFIG(release, debug|release) {
            LIBS += -L$$OUT_PWD/../B/release -lB
        }
        else {
            LIBS += -L$$OUT_PWD/../B/debug -lB
        }
    }
    

    At compile time we don't need to link A, but at runtime, we'll have to add it to the Runtime environment Path.
    Is it possible to add a runtime path from the .pro file, like QMAKE_RPATHDIR seems to do on Linux?
    Is it ok to use -L just to add a runtime path or is there a specific qmake variable for this?

    win32 {
        CONFIG(release, debug|release) {
            LIBS += -L$$OUT_PWD/../B/release -lB  -L$$OUT_PWD/../A/release
        }
        else {
            LIBS += -L$$OUT_PWD/../B/debug -lB    -L$$OUT_PWD/../A/debug
        }
    }
    

    2/- Change path order
    I'm using a more recent MinGW that the one provided by Qt 6.2. And I need to move it up for each unit test:
    eaa6016d-1243-4082-9aed-5c5c92dbfbaf-image.png

    Is it possible to configure it from .pro files and commit this change?

    Thanks a lot!

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

      https://stackoverflow.com/questions/107888/is-there-a-windows-msvc-equivalent-to-the-rpath-linker-flag

      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