这是我想要做的:
make all将构建我的库和它的文档.make test将构建我的lib(如果需要),gtest然后我的测试make check运行make test然后运行可执行文件现在我只是设法让第一个工作.我遇到的问题是有条件包括gtest.
Gtest使用CMake这很好,理论上我需要做的就是包含gtest目录add_subdirectory但是gtest将始终构建.
我现在的结构是:
CMakeLists.txt (Here I add targets for doc and the library)
doc (my doxygen docs)
include (my headers)
lib (where my compiled libraries go)
src (where my .cpp files go)
test
CMakeLists.txt (Here I add targets for gest and my tests)
bin (where the test executable will go)
contrib (where gtest is)
src (my tests)
我试图弄清楚如何将gtest作为依赖项添加到test-target但不是每次都构建gtest.
我真的很生气,而且关于学习CMake的信息几乎没有,所以如果有人知道任何深入的教程(可以在互联网上免费获得)那将是非常棒的.
| 归档时间: |
|
| 查看次数: |
2876 次 |
| 最近记录: |