How to specify "shadow build=true" and set build directory in the *.pro file?



  • Could you please advise how can I set "shadow build=true" and specific build directory in the *.pro file?
    Or at least how can I do that when I run qmake command?
    By default qmake places Make files in the each project directory.



  • Hi,
    I don't think it will be set in the pro file, but in the pro.user file.
    It might be better to use the QtCreator projects tab to change your settings and check what happens to that file.



  • [quote author="Jeroentje@home" date="1397050823"]Hi,
    I don't think it will be set in the pro file, but in the pro.user file.
    It might be better to use the QtCreator projects tab to change your settings and check what happens to that file.
    [/quote]

    It sounds good but...

    My project is used by a lot of developers and I cannot force them to set the same settings in their QtCreator's. People just download the pro file from the source control system and this pro file must be configured correctly for using in the QtCreator.

    Also pro.user file is not recommended for replacing between machines (this file contains locale ID's)

    Also build machine runs qmake + pro file in the command line and I want to set specific build directory. By default it's the dir of the each project and "shadow build=false".


  • Lifetime Qt Champion

    Looks like duplicate of this "thread":http://qt-project.org/forums/viewthread/40555/

    Have a look at "this":http://qt-project.org/doc/qtcreator-3.0/creator-sharing-project-settings.html

    For the build machine, just create the build folder and call qmake from there.



  • [quote author="SGaist" date="1397052406"]Looks like duplicate of this "thread":http://qt-project.org/forums/viewthread/40555/

    Have a look at "this":http://qt-project.org/doc/qtcreator-3.0/creator-sharing-project-settings.html

    For the build machine, just create the build folder and call qmake from there.[/quote]

    Oh... Sharing of the pro.user looks good... I'm going to investigate about it.



  • I cannot make pro.shared work...

    I've created following pro.user.shared file:
    @
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE QtCreatorProject>
    <qtcreator>
    <data>
    <variable>ProjectExplorer.Project.Target.0</variable>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">../build/qmakeTesting-Qt_5_2_1_msvc2010-Debug</value>
    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
    </valuemap>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
    <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">../build/qmakeTesting-Qt_5_2_1_msvc2010-Release</value>
    <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
    </valuemap>
    </data>
    </qtcreator>

    @

    But when I open pro file following window is showed and pro.user.shared params are not loaded
    !http://oi58.tinypic.com/2w4d6xd.jpg(warning)!


  • Lifetime Qt Champion

    You didn't create a pro.shared file but a pro.user.shared that might be the problem



  • [quote author="SGaist" date="1397064072"]You didn't create a pro.shared file but a pro.user.shared that might be the problem[/quote]

    Sorry, I've changed the message above, I create pro.user.shared file.

    In the result, I've created full copy of pro.user, rename it to pro.user.shared. It works. After that I deleted lines one by one... And if the pro.user.shared file contains full original section ProjectExplorer.Project.Target.0 (it's about 50 lines) then it works, if I delete one or few lines it shows message mentioned above and doesn't apply build directory to the pro.user file.

    I cannot use this full section. It has list of sub projects and other local information. I need only build directory and shadow build option.

    So... This cool option (pro.user.shared file) doesn't work completly.





  • [quote author="andreyc" date="1397068610"]According to the "doc":http://qt-project.org/doc/qtcreator-3.0/creator-sharing-project-settings.html#creating-shared-settings-file the file name is .pro.shared
    [/quote]

    Hm...
    QtCreator doesn't react to the pro.shared file absolutly... But it reads pro.user.shared file



  • In the qtcreator sources the file name suffixes are calculated like this
    @
    m_userSuffix = generateSuffix(QString::fromLocal8Bit(qgetenv("QTC_EXTENSION")), QLatin1String(".user"));
    m_sharedSuffix = generateSuffix(QString::fromLocal8Bit(qgetenv("QTC_SHARED_EXTENSION")), QLatin1String(".shared"));
    @

    So it should read .pro.shared file. :-)
    But anyway in the "doc":http://qt-project.org/doc/qtcreator-3.0/creator-sharing-project-settings.html#creating-shared-settings-file it says
    "Typically, you would share some of the values in the ProjectExplorer.Project.EditorSettings section."
    Which is less then you are trying to share.

    It looks like you are creating a pretty complex build environment.
    Maybe qmake is not suitable for such task.
    Have you looked on "qbs":http://qt-project.org/doc/qbs-1.1/index.html ?


Log in to reply