# How to support multiple unique configurations of a project in a monorpeo?

**URL:** <https://discourse.cmake.org/t/how-to-support-multiple-unique-configurations-of-a-project-in-a-monorpeo/4081>\
**Category:** Code\
**Created:** [September 13, 2021, 6:44pm UTC](https://discourse.cmake.org/t/how-to-support-multiple-unique-configurations-of-a-project-in-a-monorpeo/4081 "2021-09-13T18:44:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nslogan](https://discourse.cmake.org/user_avatar/discourse.cmake.org/nslogan/32/1780_2.png) [@nslogan](https://discourse.cmake.org/u/nslogan)\
**Post date:** [September 13, 2021, 6:44pm UTC](https://discourse.cmake.org/t/how-to-support-multiple-unique-configurations-of-a-project-in-a-monorpeo/4081/1 "2021-09-13T18:44:23Z")

</div>

I am working in a monorepo that utilizes an RTOS for multiple embedded targets. This RTOS project does not use CMake as its build system, so I am providing the integration into CMake. To build a firmware binary, the RTOS sources need to be linked with the application sources to form a single executable.

The challenge I have run into is related to operating within in a monorepo: If I configure the CMake support for this RTOS to use targets, I will not be able to configure the RTOS project multiple times without triggering duplicate target errors (assuming I don’t configure target names using some sort of user-provided namespace).

My first thought is to add a “namespace” component to the target configuration, e.g. `<NS>::<rtos-ns>::rtos` where `<NS>` is, for example, the value of `PROJECT_NAME` (though it could also be user-provided). The downside of this is some possible confusion in the `target_link_library` call that consumes the library as it would include a namespace provided by the project.

My use case does seem a bit uncommon - needing to configure a set of sources to be built with a project + building multiple of these projects in a monorepo - but I am curious what approaches others would take?

Thanks!
