CMake manage multiple different projects

Hello,

There are multiple independent projects, and i use CMake to build each project. (each projects has it’s config/build/install)
Now I want to integrate all projects by using cmake and git submodules, there is a root CMakeLists.txt. I encountered following problems,

  1. in different independent projects, there are many same var name, how can i configure them separately in root CMakeLists.txt
  2. how can i manage each projects, add_subdirectory()?

For these kinds of setups, it is usually better to use a “superbuild” concept where you use the ExternalProject module to build the projects. Projects not set up to be used via add_subdirectory usually have many “barbs” which trip up “sibling” projects.

Cc: @craig.scott