Reorganize CPack management

- Move all CPack variable setting to a separate file to reduce clutter
  in the main CMakeLists.txt.
- Move calling CPack to the end of the build system, since this allows
  gathering information for CPack from other parts.  Also some other
  CPack features (like identifying the existing components) works better
  there.
- Instead of hard-coding the generated directories to include in the
  source package, add a helper function that can be called from the code
  that actually does the generation.  This makes it a lot easier to
  understand how this works from just reading the CMake code.
- Add some TODOs for further improvements.

Change-Id: I2ca76f0f3b3e848527f2340b4aab1d62a5de8328