diff --git a/qtbase.pro b/qtbase.pro
index 60497a80d1fdce5c247b6ebb9310dcd11176c19f..02dc11eac2df1650d0cdae67579b7a9ff3035e3b 100644
--- a/qtbase.pro
+++ b/qtbase.pro
@@ -82,7 +82,7 @@ INSTALLS += syncqt
 
 # If we are doing a prefix build, create a "module" pri which enables
 # qtPrepareTool() to find the non-installed syncqt.
-prefix_build {
+prefix_build|!equals(PWD, $$OUT_PWD) {
 
     cmd = perl -w $$shell_path($$PWD/bin/syncqt.pl)