Embedding one cmake project inside of another?

后端 未结 1 1641
小鲜肉
小鲜肉 2020-12-28 13:29

I have two projects, both of which use CMake. Now I want to include one of the projects as a library inside the other, while still maintaining the ability to compile them as

相关标签:
1条回答
  • 2020-12-28 14:08

    CMake 2.8 added a new External Project module, which lets you create a custom target to drive the build of another CMake project. The documentation on this is kind of weak, but it looks like it might do what you want.

    I think the idea would be to call ExternalProject_Add from your parent project, pointing it to the source directory of the child project (you can even have it check the child project out of SVN or CVS for you, nice!).

    0 讨论(0)
提交回复
热议问题