qt5base-lts/mkspecs/features/qt_prefix_build_check.prf
Joerg Bornemann bb5a505d43 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>
2020-04-08 15:14:09 +02:00

22 lines
603 B
Plaintext

#
# W A R N I N G
# -------------
#
# This file is not part of the Qt API. It exists purely as an
# implementation detail. It may change from version to version
# without notice, or even be removed.
#
# We mean it.
#
defineTest(qtIsPrefixBuild) {
prefixdir = $$1
# qtbase non-prefix build?
exists($$prefixdir/.qmake.cache)|exists($$prefixdir/CMakeCache.txt): \
return(false)
# top-level non-prefix build?
contains(prefixdir, .*/qtbase):if(exists($$dirname(prefixdir)/.qmake.super)|exists($$dirname(prefixdir)/CMakeCache.txt)): \
return(false)
return(true)
}