diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-06-26 20:45:11 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-06-29 12:47:59 +0200 |
commit | 943340222e841904707dc4f3e08f0df57d2e5c28 (patch) | |
tree | ddafe167749aeb63dfc7c806a5aabc9e5c50df21 /cmake/QtBuild.cmake | |
parent | 8df4caf554e81e7de9e0154a15544426e99acbbc (diff) |
CMake: Generate qdevice.pri when cross-building
This adds the CMake equivalent to the classical -device-option key=value
configure argument:
-DQT_QMAKE_DEVICE_OPTIONS=key1=value1[;keyN=valueN]
The keys and values get dumped verbatim into qdevice.pri.
This patch also ports the machineTuple configure test. Its result is
written into qdevice.pri as value for the GCC_MACHINE_DUMP variable.
Change-Id: I29f2323fd87639fafaed99ec7446c7ee75504705
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtBuild.cmake')
-rw-r--r-- | cmake/QtBuild.cmake | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index daa98d9498..4ddb61aec3 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1244,6 +1244,28 @@ QT_PATCH_VERSION = ${PROJECT_VERSION_PATCH} qt_install(FILES "${qconfig_pri_target_path}" DESTINATION ${INSTALL_MKSPECSDIR}) endfunction() +# Creates mkspecs/qdevice.pri which contains target device information for cross-builds. +# The content of QT_QMAKE_DEVICE_OPTIONS is written verbatim into qdevice.pri. +function(qt_generate_global_device_pri_file) + if(NOT CMAKE_CROSSCOMPILING) + return() + endif() + + qt_path_join(qdevice_pri_target_path ${PROJECT_BINARY_DIR} ${INSTALL_MKSPECSDIR} "qdevice.pri") + + set(content "") + foreach(opt ${QT_QMAKE_DEVICE_OPTIONS}) + string(APPEND content "${opt}\n") + endforeach() + + if(TEST_machine_tuple) + string(APPEND content "GCC_MACHINE_DUMP = ${TEST_machine_tuple}\n") + endif() + + file(GENERATE OUTPUT "${qdevice_pri_target_path}" CONTENT "${content}") + qt_install(FILES "${qdevice_pri_target_path}" DESTINATION ${INSTALL_MKSPECSDIR}) +endfunction() + function(qt_get_build_parts out_var) set(parts "libs") |