默认情况下使用CTest将BUILD_TESTING设置为OFF

时间:2017-01-24 16:09:11

标签: cmake ctest

当您在CMake中option(BUILD_TESTING "Build the testing tree." ON) 时,它包含value(for...)行:

var fileName = "https://something.something.something/something/filename.abc";
var f = Path.GetFileName(fileName);

我希望默认情况下不构建测试(但在命令行上可以覆盖)。我怎么能这样做?

1 个答案:

答案 0 :(得分:4)

啊这似乎可以解决问题:

option(BUILD_TESTING "" OFF)
include(CTest)