首页 > 解决方案 > 带有模块化库的 C++ cmake 项目结构

问题描述

我一直在搜索,但似乎找不到关于如何使 CMAKE C++ 项目高度模块化的良好且一致的信息。

关于项目的信息:

我想做的事:

找到一个可以传达项目架构的项目结构。

如果我不得不猜测,它会是什么样子:

project_root/
-CMakeLists.txt (the main cmake file)
-thirdparty/
---ExtLib/ (contains include/, src/, CMakeLists.txt)
-src/
---Main.cpp
---depends/
-----TheLib/
-------CMakeLists.txt (cmake file for TheLib)
-------include/
---------TheLib/
-----------TheLib.h
-------src/
---------TheLib.cpp
---------depends/
-----------SubLib1/ (contains include/, src/, CMakeLists.txt)
-----------SubLib2/ (contains include/, src/, CMakeLists.txt)

问题:(我知道他们很多,任何对他们的帮助将不胜感激)

谢谢你。

标签: c++cmakestructurelibraries

解决方案


推荐阅读