You could the following qmake function to run the cmake and etc. processes for you:
Executes the given command in a secondary shell. Succeeds if the command returns with a zero exit status; otherwise fails. You can check the return value of this function using a scope.
For example:
system(ls /bin):HAS_BIN=FALSE
See also the replace variant of system().