I have doubts about my Qt .pro file… I had seen another post about a similar question in this link, but i used the contains() function and didn’t work.
In the my case, i have a file called mainconfig.h where i define some project configurations flags, i really create defines there, like: “#define MY_CONFIG_DEFINE”. Those flags define what menu options will be shown etc. My problem is: all files are always compiled, even when i don’t use its because i defined some flag in “mainconfig.h” file. I would like to avoid compile some files than i will not use, defining some variables in my .pro file and doing conditional commands, including only the files than i want to.
Can someone help me?
I tried this in my .pro file:
# This variable defines the current project ADRIANO_PROJECT = PROJECT_TYPE_1
ADRIANO_PROJECT = PROJECT_TYPE_1
(...)
FORMS += ui/form1.ui \
contains(ADRIANO_PROJECT, PROJECT_TYPE_1) {
ui/myform1.ui \
ui/myform2.ui \
}
ui/form2.ui \
ui/form3.ui
(...)
# This is only a example, ok?
Sorry my english and thanks.
IMHO your syntax is wrong. Try this instead: