diff options
Diffstat (limited to 'cmake/qt.toolchain.cmake.in')
-rw-r--r-- | cmake/qt.toolchain.cmake.in | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/cmake/qt.toolchain.cmake.in b/cmake/qt.toolchain.cmake.in index d623d9c0fb..e7af642c05 100644 --- a/cmake/qt.toolchain.cmake.in +++ b/cmake/qt.toolchain.cmake.in @@ -6,9 +6,19 @@ @init_vcpkg@ -if(qt_chainload_toolchain_file) - include("${qt_chainload_toolchain_file}") - unset(qt_chainload_toolchain_file) +if(__qt_chainload_toolchain_file) + get_filename_component(__qt_chainload_toolchain_file_real_path + "${__qt_chainload_toolchain_file}" REALPATH) + if(__qt_chainload_toolchain_file_real_path STREQUAL CMAKE_CURRENT_LIST_FILE) + message(FATAL_ERROR + "Woah, the Qt toolchain file tried to include itself recusively! '${__qt_chainload_toolchain_file}' " + "Make sure to remove qtbase/CMakeCache.txt and reconfigure qtbase with 'cmake' " + "rather than 'qt-cmake', and then you can reconfigure your own project." + ) + else() + include("${__qt_chainload_toolchain_file}") + endif() + unset(__qt_chainload_toolchain_file) endif() # Compute dynamically the Qt installation prefix from the location of this file. This allows |