diff --git a/CMakeLists.txt b/CMakeLists.txt index b975d490..0d1f9dee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,7 +74,9 @@ if(CLANG_TIDY AND PROTOBUF_FOUND) ${CMAKE_SOURCE_DIR}/test/unit/*.cpp ${CMAKE_SOURCE_DIR}/tools/*.cpp ) - add_dependencies(clang-tidy writer_tests) + if(BUILD_TESTING) + add_dependencies(clang-tidy writer_tests) + endif() else() message(STATUS "Looking for clang-tidy - not found") message(STATUS " Build target 'clang-tidy' will not be available.")