Results 1 to 4 of 4

Thread: project file with "subdirs" and different compilers

  1. #1
    Join Date
    Jan 2017
    Posts
    2
    Qt products
    Qt4

    Default project file with "subdirs" and different compilers

    Hi all,

    I have a .pro file with the TEMPLATE subdirs. Most of the project should compile with the compiler setup in the project environment.

    But I have some subdirs that should compile with a specific (e.g. older) compiler version.

    Is this possible within the .pro file or somehow in qtcreator? Because I can only use one "kit" for the whole project.

    Otherwise I have to open those sub projects with an separate qtcreator.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: project file with "subdirs" and different compilers

    You could try setting the QMAKE_CC and QMAKE_CXX variables inside the subdirectory's .pro file.

    Cheers,
    _

  3. #3
    Join Date
    Jan 2017
    Posts
    2
    Qt products
    Qt4

    Default Re: project file with "subdirs" and different compilers

    Thank you for the answer. Sorry for late response, didn't had time to test it.

    Seems to work for the compiler. Can I also change the mkspec? It is set with -spec option for the whole projoct but if an other compiler is used another spec should be selected. Or do I have to overwrite all Options manually?

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: project file with "subdirs" and different compilers

    Hmm, good question.

    You could try including the other mkspec, i.e. using the include() function.

    Alternatively you could try removing the subdir from SUBDIRS and instead have a custom command that runs a different qmake on the subdir, or with different arguments.

    Cheers,
    _

Similar Threads

  1. Replies: 1
    Last Post: 1st November 2016, 23:02
  2. "Render" Qt dialog window from ".ui" file
    By BitEater in forum Qt Programming
    Replies: 1
    Last Post: 8th July 2011, 14:40
  3. Replies: 3
    Last Post: 15th February 2010, 17:27
  4. Replies: 3
    Last Post: 8th July 2008, 19:37
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.