using the system function in qmake
I was trying to run the system command in qmake and execute a perl one liner.
Would anyone know what this command is not properly interpreted by qmake version 4?
- CMD2 = $$system(perl -MCwd -MFile::Basename -MFile::Spec -e '$_=&getcwd();while($_ ne "/"){if( -e File::Spec->catfile($_,"rules.make")){print $_;last;} $_=dirname($_);} ' )
- message("CMD " $${CMD2} )
I accidentally used qmake version 3 and it ran fine.
Any help would be greatly appreciated.
DannyK
[Edit: Removed double posting /Vass]
3 replies
Thanks.
Using a file is where I started but I still have to know where the file is. My hope was to have a small line in each of my project files that determined the location of the specific file.
Although I would love to know why Qt3 runs in fine and Qt4 qmake does not.
I figured out a qmake project file version that seems to work.
- rules_dir=$$IN_PWD
- pwd=$$split(IN_PWD,/)
- for(p,pwd){
- exists($$rules_dir/rules.make):eval(RULES_DIR=$$rules_dir):break()
- else:rules_dir=$$dirname(rules_dir)
- }
[EDIT: code formatting, please wrap in @-tags, Volker]
You must log in to post a reply. Not a member yet? Register here!


