Solved How to differentiate different compiling options
-
I just knew we can do this by giving different extensions to the .pro file. For example,
we may give .pro file the extension Qt5_4_0 or Qt5_3_0 to differentiate different Qt SDK versions, thus the names of the project files may ${PROJECT}.pro.Qt5_4_0 or ${PROJECT}.pro.Qt5_3_0. Then what is the macro name to define the extensions as an environement variable, thx a lot! -
Usually you just use different kits with different compiler/Qt/.. to build for different Qt versions.
I don't see any need to have several PRO files. -
@andreank How is this related to the original post?
-
@jsulm for example, i want to compile for the targets both of windows and android based on the same suite of source code, how can i handle two .pro files?
-
-
This post is deleted! -
@SGaist ok, thx, while there may be another scenario: two developer work on the same suite of source codes on two different platforms, for example, windows and linux. they want to upload and share the project to the same git respository for further sharing or restore, then how can we differentiate the same .pro file name but with two different content due to different platforms and compiling environments.
@SGaist said:
@jsulm It wasn't at all, just a spam for an unhealthy website so removed.
@rintec you can use the same .pro file.
If you need something specific you can use e.g. scopes:
android { DEFINES += MY_ANDROID_STUFF } win32 { SOURCES += my_win32_code.cpp }
-
OK, thx everyone, I have just found the answer. It's the macro QTC_EXTENSION. which may change the extension of .pro.user, that is, .user, to everything you want!
-
Again: you don't need to do that. Just use the same .pro file with scopes. You may have to occasionally do some merging by hand but with a proper source control system it's not a problem.
The .pro.user files are tied to the machine you are running Qt Creator on. You can keep some common configs in a .pro.shared file but the .pro.user should not be commit to source control.
Also, if they have to work on feature for specific OSs, they should do so in their own branch and once that's done, everything should be merged back to master.
-
@SGaist ok, thx a lot!