Dependency Issues of CPack
Previously, when using CPack to package a QML program, I noticed that the files installed by the CPack package differed significantly from those installed using the cmake install command. Below, I will explain and resolve this issue.
1. Problem code
Let’s take the previously written QML program as an example. To facilitate code improvements, the CMakeLists.txt is rewritten as follows, with dependency installation and packaging modules written separately into cmake/dependencies.cmake and cmake/packaging.cmake.