[CMake] Using clang-tidy with cmake 3.6.0
Bill Hoffman
bill.hoffman at kitware.com
Wed Jul 20 16:29:19 EDT 2016
On 7/20/2016 4:02 PM, Robert Maynard wrote:
> I believe the correct form is:
>
> set_target_properties(example PROPERTIES CXX_CLANG_TIDY
> "${path_to_tidy} -some -args")
No, that won't work.
You want it to be a semi-colon separated list of arguments. Not space
separated.
https://cmake.org/cmake/help/v3.6/prop_tgt/LANG_CLANG_TIDY.html#prop_tgt:<LANG>_CLANG_TIDY
In a ctest script it would be done something like this:
set(DASHBOARD_CLANG_TIDAY
"/path/to/clang-tidy" "-arg1" "-arg2")
Then put this in the cache:
"CMAKE_CXX_CLANG_TIDY:STRING=${DASHBOARD_CLANG_TIDY}"
-Bill
More information about the CMake
mailing list