Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How can I use relative paths for "Build Directory" under Qt Creator Mac OS X



  • Hi all,

    Have the following issue under Qt Creator Mac OS X 2.0.1 with SDK 4.7.1.

    Under the "Projects" tab, for all of the configurations, there's a "Build directory" field. I want the following directory structure under my home directory:

    /home
    /home/Development
    /home/Development/src
    /home/Development/shadow

    If I put an absolute path in like:

    /home/Development/shadow

    it works for me. However, if I were to use a relative path like:

    ../shadow

    for a project from /home/Development/src, the build winds up in /Developer/Applications/Qt/shadow

    What am I missing here? Is there an environment variable I haven't set yet?

    Thanks in advance.

    Andrew



  • I think you should work with Qt Resources:
    http://doc.qt.nokia.com/4.7/resources.html

    and you are not going to have any more problems about absolut or relative paths.
    It's something really useful.



  • [quote author="diegosarmentero" date="1298046196"]I think you should work with Qt Resources:
    http://doc.qt.nokia.com/4.7/resources.html

    and you are not going to have any more problems about absolut or relative paths.
    It's something really useful.[/quote]

    Qt resources are absolutely unrelated to shadow builds.


  • Moderators

    There is a variable for the source directory. You should be able to use that to "anchor" to it and go to some other place relative to it.

    Please check the documentation for a list of available variables.

    IIRC you need 2.1 for this to work... it is available on our ftp site.



  • Tobias, am I looking for this in the QMake reference, or somewhere else?

    Can anyone else point me in the correction direction? Using something like ../shadow works on Windows, but on Mac, it goes to somewhere I don't expect or want.



  • Just to add one thought, this is for the *.pro.user files, not the *.pro files.


  • Moderators

    I was actually referring to the Qt Creator manual:-)

    Feel free to file "a bugreport":http://bugreports.qt.nokia.com/ if this works differently on windows and mac.



  • Have it working correctly now. As you suggested previously, I downloaded Qt Creator 2.1 now that it is officially released and it handles this case correctly.

    The key is the SOURCEDIR variable. By using this, I can have the relative path

    $SOURCEDIR/../shadow

    and it works correctly on Mac.


Log in to reply