directions.txt 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. # Packaging Debug and Release #
  2. By default CMake is model is that a build directory only contains a single
  3. configuration, be it Debug, Release, MinSizeRel, or RelWithDebInfo.
  4. But it is possible to setup CPack to bundle multiple build directories at the same
  5. time to build a package that contains multiple configurations of the same project.
  6. First we need to ahead and construct a directory called 'multi_config' this
  7. will contain all the builds that we want to package together.
  8. Second create a 'debug' and 'release' directory underneath 'multi_config'. At
  9. the end you should have a layout that looks like:
  10. ─ multi_config
  11. ├── debug
  12. └── release
  13. Now we need to setup debug and release builds, which would roughly entail
  14. the following:
  15. cd debug
  16. cmake -DCMAKE_BUILD_TYPE=Debug ../../MultiPackage/
  17. cmake --build .
  18. cd ../release
  19. cmake -DCMAKE_BUILD_TYPE=Release ../../MultiPackage/
  20. cmake --build .
  21. cd ..
  22. Now that both the debug and release builds are complete we can now use
  23. the custom MultiCPackConfig to package both builds into a single release.
  24. cpack --config ../../MultiPackage/MultiCPackConfig.cmake