Using the same namespace for multiple independant projects

Hi,
Is there a way to use the same namespace accross multiple packages, like:

find_package(prog_extA)
find_package(prog_extB)
target_link_librairies(target PUBLIC prog::extA prog::extB)

Or even, register multiple packages in the same “meta”-package, like:

find_package(prog)
target_link_librairies(target PUBLIC prog::extA prog::extB)

But without the use of the component mechanism, which would require that all extensions are handled in the same CMake project. My goal is to be able to build sub-packages in fully independant CMake projects. And from my understanding, it is not possible with the component mechanism(?)

Thanks.

There’s no rule about namespaces having to match the package name in general, so prog_extA and prog_extB can both use NAMESPACE prog:: just fine.

And Qt does the second part as well (using COMPONENTS to look for the “extensions”).

AFAIU configuration file creation, when I’m creating extA in a namespace prog, I will in fact create some progConfig.cmake, progTargets.cmake and progTargets-<build type>.cmake files. Thus when I will create extB I will overwrite these files and only prog::extB will be visible?