Qt: passing variables to subprojects -
Qt: passing variables to subprojects -
the construction of project follow:
proj proj.pro --subproj --subproj.pro ----subsubproj ----subsubproj.pro
is there way can instance global variable in subproj.pro , phone call en e.g. subsubproj.pro like:
proj.pro:
global_var = true
subsubproj.pro:
message($$global_var)
update maybe should more precise problem.
the usual behavior in qt creator when right-click on proj , take "build project"proj"" qmake proj.pro gets invoked qmake subproj.pro , subsubproj.pro
what want accomplish is:
when build project "proj" proj.pro , subproj.pro invoked (not subsubproj.pro) but: when build project "subproj" invoked files subproj.pro , subsubproj.proyou accomplish 1) adding subproj.pro:
template = subdirs dont_invoke_subsub{ subdirs = subsubproj }
in case when qmake proj.pro 1) fulfilled. when qmake subproj.pro subsubproj doesnt built neither.
so thought hand on variable proj subproj.
proj.pro: global_var = true;
and subproj retrieves variable:
subproj.pro template = subdirs equals(global_var, true){ # nil because proj.pro invokes } else { # invoke qmake subsubproj.pro subdirs = subsubproj }
i managed include(...)
command via config files.
an other way (but more limited) utilize config+=global_var
in qmake
arguments list. technique quite useful 'master' switchs.
but both of them can't alter global_var
during pre-build process (qmake step) ...
qt parameter-passing qt-creator qmake
Comments
Post a Comment