diff options
author | Craig Scott <craig.scott@qt.io> | 2021-11-24 13:35:41 +1100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-12-08 19:50:21 +0100 |
commit | 22c92f39670d0376478cc2e73a17307508f86692 (patch) | |
tree | 87fd705bad0c02414b03deb674ae810b6dbdb159 /src/corelib/doc/src/includes/cmake-deploy-runtime-dependencies.qdocinc | |
parent | 3ee79be6280119afd5d1fb98df4320f0b105aa47 (diff) |
Add documentation for CMake deployment support
Task-number: QTBUG-98545
Change-Id: Ifd5c0f4ce278c683bb0d3ba6a259ec14a7f24181
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/corelib/doc/src/includes/cmake-deploy-runtime-dependencies.qdocinc')
-rw-r--r-- | src/corelib/doc/src/includes/cmake-deploy-runtime-dependencies.qdocinc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/corelib/doc/src/includes/cmake-deploy-runtime-dependencies.qdocinc b/src/corelib/doc/src/includes/cmake-deploy-runtime-dependencies.qdocinc new file mode 100644 index 0000000000..6faf1a3cdf --- /dev/null +++ b/src/corelib/doc/src/includes/cmake-deploy-runtime-dependencies.qdocinc @@ -0,0 +1,22 @@ +\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}/$<TARGET_FILE_NAME:MyApp>\" +) +") + +install(TARGETS MyApp) # Install the target +install(SCRIPT ${deploy_script}) # Add its runtime dependencies +\endcode |