Build Multiple Projects in a Workspace

In some use cases it is necessary to build multiple repositories containing dependant libraries. In this example we build the libraries in the bde and my_app source code repositories as part of a single workspace.

Download Libraries

In this example, we are using bde and my_app:

$ git clone https://github.com/bloomberg/bde.git
$ git clone https://github.com/<user>/my_app.git

Create workspace CMakeLists.txt

  • Create CMakeLists.txt file to build both libraries:

# CMakeLists.txt for a workspace
cmake_minimum_required(VERSION 3.22)
project(workspace)

enable_testing()

add_subdirectory(bde)
add_subdirectory(my_app)

Configure and Build the Workspace

Proceed with setting up the environment and building as usual.