【发布时间】:2016-02-09 09:55:16
【问题描述】:
在我的顶级 CMakeLists.txt 中,我包含了一些外部库。如果我为我的项目启用测试并且外部库的 CMakeLists 也调用 enable_testing(),则这些测试将添加到我自己的项目测试中,然后由于未构建库的测试而无法运行。
我不希望构建测试,也不希望它们弄乱我自己的项目测试。我该怎么做?
在我的 CMakeLists.txt 中:
add_subdirectory(some_ext_lib EXCLUDE_FROM_ALL) ' some_ext_libs tests should not be built nor run
enable_testing()
add_subdirectory(my_own_stuff) ' here the tests should be run
[...]
【问题讨论】:
标签: cmake