summaryrefslogtreecommitdiffstats
path: root/cmake/QtLoadFilePrintVars.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Make toolchain inspection more robust"Joerg Bornemann2021-07-021-15/+0
| | | | | | | | | | | | | | | | | This reverts commit 7c62caa3555d247be569102d8f01b3e7ae362b8a. Certain toolchain files cannot be read in CMake script mode with CMake versions >= 3.20. For example, the vcpkg toolchain file overrides add_executable, and that fails with CMake 3.20: CMake Error at D:/dev_tools/vcpkg/scripts/buildsystems/vcpkg.cmake:662 (function): Built-in flow control command "add_executable" cannot be overridden. Pick-to: 6.2 Fixes: QTBUG-93627 Change-Id: Ib6e6352dff50b9684dcf81401d138e27e16292c3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Make toolchain inspection more robustJoerg Bornemann2021-03-041-0/+15
QtAutoDetect.cmake did read the (possibly detected) toolchain file and looked for the string "The Android Open Source Project" to deduce that we want to build for Android. This has been done, because we're autodetecting the platform before the first project comment, i.e. before the toolchain file is loaded. This magic string detection is a bit fragile, and we need a similar approach for WebAssembly. A more robust approach would be to fetch the value of CMAKE_SYSTEM_NAME from the toolchain file without actually loading it. Now, we run a CMake script that includes the toolchain file and prints variables were interested in. The calling code reads these variables and stores them in prefixed variables in the current scope. Change-Id: Ide9ea3054e1453d17129523e1ec86ecaed55af2a Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Cristian Adam <cristian.adam@qt.io>