CMake/qmake: Fix qtIsPrefixBuild for a CMake-built qtbase

In addition to .qmake.cache and .qmake.super we check for the
existence of CMakeCache.txt. The top-level non-prefix build part is
prospective, but seems plausible.

Without this fix, non-prefix qmake builds build libs etc. in the wrong
locations, i.e. not in a subdirectory of qtbase.

Change-Id: Ic88efa6c772d49ef92713fe640f004c8a5c849d3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2020-04-07 16:10:23 +02:00
parent 5422fb7948
commit bb5a505d43

View File

@ -12,10 +12,10 @@
defineTest(qtIsPrefixBuild) {
prefixdir = $$1
# qtbase non-prefix build?
exists($$prefixdir/.qmake.cache): \
exists($$prefixdir/.qmake.cache)|exists($$prefixdir/CMakeCache.txt): \
return(false)
# top-level non-prefix build?
contains(prefixdir, .*/qtbase):exists($$dirname(prefixdir)/.qmake.super): \
contains(prefixdir, .*/qtbase):if(exists($$dirname(prefixdir)/.qmake.super)|exists($$dirname(prefixdir)/CMakeCache.txt)): \
return(false)
return(true)
}