Use-case: Make building unit tests optional, by just following the CMake
BUILD_TESTING option.
The usual approach to conditionally build tests is to do:
if (BUILD_TESTING) add_executable(TestOne TestOne.cpp) target_link_libraries(TestOne my_library) endif()
or:
if (BUILD_TESTING) add_subdirectory(tests) endif()
This patch just turns all calls to ecm_add_test(...) into no-ops if
BUILD_TESTING=OFF.
See:
https://cmake.org/cmake/help/v3.6/module/CTest.html