0

Can I have the same submodule multiples time in the same repository?

I want to use spdlog open source submodule in my project, but my project has some personal submodules integrated. Some of those submodules also use spdlog. It is possible to use the same submodule multiple times without having conflicts?

This is how my project is structured:

MY_PROJECT
    INCLUDES
    SRC
    LIBS
      spdlog
      submod_1
      submod_2
         includes
         src
         libs
          spdlog

When I try to build my project, I get an error from Cmake.enter image description here

The path that is not shown is the path from submod_2/libs/spdlog. From what I understand, when I build the project, both instances of spdlog are being built and the error is generated by the fact that submod_2 has already built spdlog with the same target name. The thing is that submod_2 is can also be used a standalone project and I can't remove spdlog from it.

Is there a way to make changes in my submodules and not in spdlog ?

padurean04
  • 27
  • 5
  • are you using find_package? add_subdirectory? fetchcontent? If add_subdirectory, then this may be a dup of https://stackoverflow.com/q/76640472/11107541. Otherwise, it should be a non-issue. – starball Aug 05 '23 at 00:39
  • 1
    Can you please read about [the problems with images of text](//meta.stackoverflow.com/a/285557/11107541) and then [edit] to **convert** your images of text into actual text? Likely useful: [/help/formatting](/help/formatting) – starball Aug 05 '23 at 00:40

0 Answers0