O'Reilly logo

CMake Cookbook by Roberto Di Remigio, Radovan Bast

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works

The superbuild is a very useful pattern in our CMake toolbox. It lets us manage complex projects by separating them into smaller, more manageable subprojects. In addition, we can use CMake as a package manager for the project we are building. CMake can search for our dependencies and, in case they are not found on the system, freshly build them for us. The basic pattern requires three CMakeLists.txt files:

  • The root CMakeLists.txt  file contains settings shared by the project and the dependencies. It also includes our own project as an external project. In our case, we chose the name ${PROJECT_NAME}_core; that is, recipe-04_core, since the project name recipe-04 is used for the superbuild.
  • The external CMakeLists.txt file will ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required