1

I'm working on a project that contains other projects as libraries using git submodules. These sub-projects are under active development as well, so the root cmake file will run the sub-project cmake files as well.

Example Project Structure:

current_project/
    src/
    include/
    docs/
    libs/
        sub_module_1/
            src/
            include/
            docs/
        sub_module_2/
            src/
            include/
            docs/
        sub_module_3/
            src/
            include/
            docs/
    src/

The actual building portion works fine. In some of the sub projects, the custom target docs is used to generate the documentation. Since there are multiple docs targets defined for each subproject, cmake complains. I don't have control over the sub-projects, and therefore cannot simply edit the cmake files for those. Is there a way to, without editing the sub-projects (as the changes will be overwritten when I do a git update), either have cmake combine all the commands for each sub-project and run all of them, or have it generate a prefix (probably the project name) for the docs target for each project?

Edit: I see that CMake has projects as a defined term. I'm not referring to cmake projects. When I am saying project, I am referring to libraries and programs that, while related, are independent of each other.

Evan
  • 508
  • 1
  • 4
  • 18
  • Note, all libraries are set as different (and unique) projects if that helps at all. – Evan Jan 07 '16 at 20:30
  • What about using `ExternalProject_Add` for submodules? See, e.g., [this question](http://stackoverflow.com/questions/1457920/embedding-one-cmake-project-inside-of-another). – Tsyvarev Jan 07 '16 at 21:39

0 Answers0