@jwuttke Yes,
By the first line you define the package generators you would like to use.
The second line makes use of the packaging functionality. It provides many generators like zip, tgz, etc.
The third line includes CPackIFW, this is a helper package for QtIFW tools. You could certainly manually set all configurations on CPack without including CPackIFW. CPackIFW is not essential to work with CPack and QtIFW tools, it simply makes live easier.
The 3rd line can be redundant, if you invest enough work into making it redundant.
CPackIFW is always included at configure time for CMake. To do that automatically CPackIFW must be used. To do it manually CPackIFW cannot be used (because you are being fancy and deliberately chose not to ). Package is automatically dependent on build, so even if you do not build your project and run
cmake --build . --target package
it is going to build your project first.
If you run cpack -G IFW
it will be a failure because the files to package do not exist. You have to build your project first!
No, the generator does not notice location variables set with CMake. Doing that is CMake’s job, you do not need to worry about it. CMake provides all information for the generator at configure time in a way the generator understands.
Conclusion: CPackIFW
is an interface for QtIFW tools. You can focus on CMake and do not need to worry about how QtIFW works. Without CPackIFW
you need to know how QtIFW tools work and make an interface for CMake.