9

When you do include(CTest) in CMake it includes this line:

option(BUILD_TESTING "Build the testing tree." ON)

I want tests to be not built by default (but overridable on the command line). How can I do that?

giordano
  • 8,087
  • 3
  • 23
  • 48
Timmmm
  • 88,195
  • 71
  • 364
  • 509

1 Answers1

11

Ah this seems to do the trick:

option(BUILD_TESTING "" OFF)
include(CTest)
Timmmm
  • 88,195
  • 71
  • 364
  • 509