Custom C++ settings and shared configurations

  • Hi.

    I created a custom C++ project that have a custom build commands and some environment variables.

    This project is hosted on my git repository.

    The problem is when i checkout in my other PC. When i open the project (flyforcoins.creator), it ask me to load an existing .user file "flyforcoins.creator.user" and i say "YES". But when i click on "Projects" menu in QtCreator, all configs are default and my .user file now is moved to other file "flyforcoins.creator.user.1d2g4g".

    What i have to do to make all the configurations shared?


  • please, help me :(

  • Moderators

    I haven't used that myself, but it seems you should create a .pro.share file (edited copy of a .pro.user) and store that in a repository instead of the local .pro.user file.

    Some info on it is "here":
    It actually says it's for sharing settings between projects, but I guess it should work for a "single project with multiple users" scenario too.

  • Hi.

    I do it now. I follow the steps in my PC:

    1 - I have closed the project in QtCreator
    2 - I have copied: flyforcoins.creator.user to flyforcoins.creator.shared
    3 - I have deleted file: flyforcoins.creator.user
    4 - I have commited all to git and push
    5 - I open the project on my PC and the settings are correct and a new flyforcoins.creator.user was created based on shared (is true that it is based on .shared file because i have tested open the project without it and the configuration are lost).

    So, in my PC i only need the .shared file. Very nice.

    Now in my other pc:

    1 - I have deleted all and made a new "git clone ...."
    2 - I see in the project path that only the .shared file is there
    3 - I open the project "flyforcoins.creator"
    4 - The configurations was lost :(
    5 - A new .user file was created

    So, dont work. Only work on my PC?

    My project is a custom c++ project - or a Import Project from QtCreator.

  • Moderators

    Hmm, sorry but you might be "out of luck":

    It seems the problem is that the .user (or .shared) file holds IDs of the kits, compilers etc. which is not shareable and thus any related information is lost. In that SO question Tobias Hunger said it might work with identical environment on those shared systems but I guess this is unmaintainable in a long run so you will have to look for other solutions.

    Some of the configuration stuff can be moved portably to the .pro file. you might also run some external scripts this way. You can dig through "qmake docs": to see what is possible.

  • Hi.

    Thanks for answer.

    But my two PCs are the same.

      • I have two macbook pro (the exact model).
      • Both use the same OSX 10.8.3.
      • Both use the same kit (in my case the kit is Desktop(default)).

    Dont have any difference in kits, in the macbook pro, nothing :(

  • Moderators

    You should not put .user files into your version control system. The file is specific to one instance of creator and can not be shared.

    What you can do is put the text editor settings, etc. into a .shared file. Putting the actual build configurations there will not work as the kits and tool chains are identified by GUIDs and he Qt versions have a integer id that is specific to one instance of creator as well. The name of the kit, etc. does not matter to creator (except to display it to the user).

    You could try to move your environment variables and special commands into the build system properly to avoid the need for the special setup.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.