fixed some build related problems
[qsqlmon.git] / qsqlmon / go_to_top.pri
blob48899fccfe483809eb0eef5357a4570603167d96
1 # utility how to find project top dir looking for the top.pri file\r
2 # on unix it should be link to unique file\r
3 \r
4 # the only loop statement in qmake is a for\r
5 # currently max for 20 levels of subdirs\r
6 \r
7 MY_TOP_PRI_FILE_NAME = top.pri\r
8 \r
9 defineReplace(goToTop) {\r
10         dirs = 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0\r
11         top = .\r
12         endfor = no\r
13         for(dir, dirs) {\r
14                 #message("$$dir")\r
15                 file = $${top}/$$MY_TOP_PRI_FILE_NAME\r
16                 contains(endfor, no) {\r
17                         exists($$file) {\r
18                                 #message("BINGO")\r
19                                 endfor = yes\r
20                                 return($${top})\r
21                         }\r
22                         #message("$$file")\r
23                         top = $${top}/..\r
24                 }\r
25     }\r
26         error("GoToTop(): cann't find project top dir definition file $$MY_TOP_PRI_FILE_NAME")\r
27 }\r
29 MY_PATH_TO_TOP = $$goToTop() \r
31 include($$MY_PATH_TO_TOP/$$MY_TOP_PRI_FILE_NAME)\r