get login name in qmake script
Solved
General and Desktop
-
wrote on 30 Nov 2021, 15:24 last edited by
I am porting some Perl code to qmake. The Perl code gets the current login name with
my($login_name) = lc getlogin;
and uses that login name for replacing some text in a configuration file. I have translated the Perl code into a
QMAKE_POST_LINK
action that does the same textual replacement, but within myQMAKE_POST_LINK
action i now also need that same login name.This should work on both Windows and Linux. Is there a way to get that login name in a qmake
.pro
file? -
wrote on 30 Nov 2021, 15:44 last edited by mchinand
Something like this:
MYUSERNAME=NO_USERNAME win32 { MYUSERNAME = $$(USERNAME) } unix { MYUSERNAME = $$(USER) } message(The username is $$MYUSERNAME)
-
wrote on 30 Nov 2021, 15:59 last edited by
Yes, thanks. That was also what I have figured out in the meanwhile :-)
3/3