CMake target_sources with different targets

With cmake we can split a project in multiple subfolders. From the top CMakeLists.txt we then call the sub CMakeLists.txt With

add_subdirectory(moduleb)

And each sub CMakeLists.txt will have an

target_sources(target SOURCES)

But what if I want to use the sub CMakeLists in multiple different top level projects? The limited understanding of CMakeLists I have seems to sugests I have to go on each sub folders and edit the CMakeList changing the target name. There must be an smarter way of dealing with this, isn't?