summaryrefslogtreecommitdiff
path: root/Tests/Tutorial/MultiPackage/directions.txt
blob: c3102bb10e3435f9b7623686f39c6e9f6450dc51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Packaging Debug and Release #

By default CMake is model is that a build directory only contains a single
configuration, be it Debug, Release, MinSizeRel, or RelWithDebInfo.

But it is possible to setup CPack to bundle multiple build directories at the same
time to build a package that contains multiple configurations of the same project.

First we need to ahead and construct a directory called 'multi_config' this
will contain all the builds that we want to package together.

Second create a 'debug' and 'release' directory underneath 'multi_config'. At
the end you should have a layout that looks like:

─ multi_config
    ├── debug
    └── release

Now we need to setup debug and release builds, which would roughly entail
the following:

  cd debug
  cmake -DCMAKE_BUILD_TYPE=Debug ../../MultiPackage/
  cmake --build .
  cd ../release
  cmake -DCMAKE_BUILD_TYPE=Release ../../MultiPackage/
  cmake --build .
  cd ..


Now that both the debug and release builds are complete we can now use
the custom MultiCPackConfig to package both builds into a single release.

  cpack --config ../../MultiPackage/MultiCPackConfig.cmake