protozero
protozero copied to clipboard
Configuration error when tests are disabled but clang_tidy is found
writer_tests used in add_dependencies does only exist if tests are enabled. Add an additional AND BUILD_TESTING:
if(CLANG_TIDY AND PROTOBUF_FOUND AND BUILD_TESTING)
message(STATUS "Looking for clang-tidy - found ${CLANG_TIDY}")
add_custom_target(clang-tidy
${CLANG_TIDY}
-p ${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/test/*.cpp
${CMAKE_SOURCE_DIR}/test/t/*/reader_test_cases.cpp
${CMAKE_SOURCE_DIR}/test/t/*/writer_test_cases.cpp
${CMAKE_SOURCE_DIR}/test/unit/*.cpp
${CMAKE_SOURCE_DIR}/tools/*.cpp
)
add_dependencies(clang-tidy writer_tests)
else()
message(STATUS "Looking for clang-tidy - not found")
message(STATUS " Build target 'clang-tidy' will not be available.")
endif()
This was fixed in #111