views:

285

answers:

1

I have split my project into several subprojects But all have a common part (directory with cmake scripts). Moreover some subproject need to include other subprojects (libraries).

I would prefer to use git submodules but as far as I know they have a limitation that a submodule needs to be in a separate directory in the repo (does it?) what ties my hands a little as I don't want to duplicate any source or cmake scripts in a superproject or any of subprojects.

How do you propose to solve it ?

+3  A: 

I don't see the problem. Your libraries should not be submodules at all, but totally separate projects. If you do want to make them submodules, they will certainly want to be in their own directories. As for the cmake scripts, you say that they are already in their own directory, so making that directory a submodule is not a problem. Perhaps you need to clarify the problem.

William Pursell
Actually your answer enlighten me.I should use cmake to search for libraries and not force git to preserve some arbitrary directory structure.
Łukasz Lew