Details
-
Suggestion
-
Resolution: Done
-
P2: Important
-
6.3.1
-
None
-
-
6ed89be125 (qt/qtbase/dev) 6ed89be125 (qt/tqtc-qtbase/dev)
Description
qt_generate_deploy_app_script generates a CMake script that calls qt_deploy_runtime_dependencies.
For setups that need customization, we currently have to generate the script like this:
set(deploy_script "${CMAKE_CURRENT_BINARY_DIR}/deploy_MyApp.cmake") file(GENERATE OUTPUT ${deploy_script} CONTENT " include(\"${QT_DEPLOY_SUPPORT}\") qt_deploy_runtime_dependencies( EXECUTABLE \"\${QT_DEPLOY_BIN_DIR}/$<TARGET_FILE_NAME:MyApp>\" GENERATE_QT_CONF )")
There's a lot of escaping going on. That doesn't help with readability.
It would be nice if the deployment code could live in a separate .cmake file.
Note that we cannot use file(GENERATE OUTPUT ... INPUT ...), because there, we don't have variable expansions, and we need to expand QT_DEPLOY_SUPPORT for the first include statement.
It would be nice to have a convenient way to specify the deployment code in a separate file. Maybe like this:
qt_generate_deploy_app_script( TARGET MyApp FILENAME_VARIABLE deploy_script INPUT ${CMAKE_CURRENT_SOURCE_DIR}/deploy_myapp.cmake NO_UNSUPPORTED_PLATFORM_ERROR )