Ideal way to build a plugin with subprojects using CMake

After accidentally creating a topic since Ctrl+Enter posts a question, here is try number two…

I have a main project with my plugin code. I want to bring in processing code other people are working on, without showing my plugin code. Other people should have a repository containing

  • a parent class for the processors they create
  • an implementation of their processor
  • a test project to test their processors (probably based on pamplejuce)

My idea is to implement a subrepo template which other people can clone.
I will then add their repos as subrepos and include them in cmake.
What is the best way to set up this structure in cmake?
Im thinking about checking a variable X in the child repository, that will only be set when its part of my larger project.
If X is true, only a certain subfolder with the subprocessor code will be included as a static library, to avoid including juce and adding the test plugin for every subrepo.
If X does not exist, juce code will be included and a test plugin will be added to the build.

Do you think Im heading the right way? Are there better way to accomplish this?
Thanks in advance!