CMake: how best to build multiple (optional) subprojects?

后端 未结 6 2047
说谎
说谎 2021-02-18 16:23

Imagine an overall project with several components:

  • basic
  • io
  • web
  • app-a
  • app-b
  • app-c

Now, let\'s say web

6条回答
  •  悲&欢浪女
    2021-02-18 17:00

    Have multiple CMakeLists.txt.

    Many open-source projects take this appraoch (LibOpenJPEG, LibPNG, poppler &etc). Take a look at their CMakeLists.txt to find out how they've done this.

    Basically allowing you to just toggle features as required.

提交回复
热议问题