This recipe shows how the superbuild pattern can be harnessed to muster the dependencies of your project. Let us take another look at the layout of the project:
.├── CMakeLists.txt├── external│ └── upstream│ ├── boost│ │ └── CMakeLists.txt│ └── CMakeLists.txt└── src ├── CMakeLists.txt └── path-info.cpp
We have introduced four CMakeLists.txt files in the project source tree:
- The root CMakeLists.txt will coordinate the superbuild.
- The file in external/upstream will lead us to the boost leaf directory.
- external/upstream/boost/CMakeLists.txt will take care of the Boost dependency.
- Finally, the CMakeLists.txt under src will build our example code, which depends on Boost.
Let us start start the discussion with the external/upstream/boost/CMakeLists.txt ...