\badcode cmake_minimum_required(VERSION 3.16...3.22) project(MyThings) find_package(Qt6 REQUIRED COMPONENTS Core) qt_standard_project_setup() qt_add_executable(MyApp main.cpp) # The following script must only be executed at install time set(deploy_script "${CMAKE_CURRENT_BINARY_DIR}/deploy_MyApp.cmake") file(GENERATE OUTPUT ${deploy_script} CONTENTS " include(\"${QT_DEPLOY_SUPPORT}\") qt_deploy_runtime_dependencies( EXECUTABLE \"\${QT_DEPLOY_BIN_DIR}/$\" ) ") install(TARGETS MyApp) # Install the target install(SCRIPT ${deploy_script}) # Add its runtime dependencies \endcode