Results 1 to 15 of 15

Thread: Passing variables/paths from ROOT Project to SUBDIRECTORY Projects without PRI

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2012
    Posts
    13
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Passing variables/paths from ROOT Project to SUBDIRECTORY Projects without PRI

    Hi Guys!

    I'm a newbie in Qt, I'm working on a project that has 1 root project and 3 subdirectory projects

    ROOT.pro
    |__
    SUB1.pro
    |__
    SUB2.pro
    |__
    SUB3.pro

    #####ROOT.pro
    TEMPLATE = subdir
    SUBDIRS += SUB1.pro\
    SUB2.pro\
    SUB3.pro
    PATHSAMPLE = $$PWD/pathsampledir/

    #####SUB1.pro
    QT += core gui
    TEMPLATE = app
    SOURCES += sub1source.cpp
    HEADERS += sub1header.h
    FORMS += sub1form.ui

    win32{
    Debug{
    DESTDIR = PATHSAMPLE
    }
    }

    #####SUB2.pro
    QT += core gui
    TEMPLATE = app
    SOURCES += sub2source.cpp
    HEADERS += sub2header.h
    FORMS += sub2form.ui

    win32{
    Debug{
    DESTDIR = PATHSAMPLE
    }
    }

    #####SUB3.pro
    QT += core gui
    TEMPLATE = app
    SOURCES += sub3source.cpp
    HEADERS += sub3header.h
    FORMS += sub3form.ui

    win32{
    Debug{
    DESTDIR = PATHSAMPLE
    }
    }

    In this case, i would like to access PATHSAMPLE from the ROOT.pro to the SUBDIRECTORIES without using/including .pri. Can you help me guys? Is it possible? What can I do to solve this one? Thanks in advance

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Passing variables/paths from ROOT Project to SUBDIRECTORY Projects without PRI

    First of all it should be DESTDIR = $$PATHSAMPLE. Second of all what's wrong with pri files?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Sep 2012
    Posts
    13
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Passing variables/paths from ROOT Project to SUBDIRECTORY Projects without PRI

    Hi Sorry for that. Yeah it should be
    DESTDIR = $$PATHSAMPLE

    I just want to know if its possible without including PRI. Is it possible Sir?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Passing variables/paths from ROOT Project to SUBDIRECTORY Projects without PRI

    As far as I remember with SUBDIR template some variables are being passed to child projects. If it doesn't work for you, you can always use environment variables.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Sep 2012
    Posts
    13
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Passing variables/paths from ROOT Project to SUBDIRECTORY Projects without PRI

    Thank You Sir.

    Can you give example Sir. I'm a little bit confused about this. And how can I check the cvariables that are being passed to child projects?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Passing variables/paths from ROOT Project to SUBDIRECTORY Projects without PRI

    Quote Originally Posted by iamDAMON View Post
    And how can I check the cvariables that are being passed to child projects?
    Observe the console output when building the projects. And I'm sure you will notice if your variable is being passed or not based on the fact whether it is respected by the child project or not.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QMake Shared/Global/Inherited Variables between projects
    By Sogartar in forum Qt Tools
    Replies: 7
    Last Post: 23rd January 2020, 12:36
  2. Passing variables between forms.
    By Splatify in forum Newbie
    Replies: 9
    Last Post: 21st February 2011, 11:12
  3. Replies: 1
    Last Post: 25th November 2010, 16:02
  4. QtCreator and paths in projects view
    By SilverHaze in forum Qt Tools
    Replies: 1
    Last Post: 19th January 2010, 21:26
  5. Replies: 2
    Last Post: 25th June 2009, 19:47

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.