2021-01-24 00:22:47 +00:00
|
|
|
get_target_property(ClangTidy_SRCS_TMP conky SOURCES)
|
2019-02-23 19:40:34 +00:00
|
|
|
get_target_property(conky_SRC_DIR conky SOURCE_DIR)
|
|
|
|
|
|
|
|
if(BUILD_TESTS)
|
2021-01-24 00:22:47 +00:00
|
|
|
get_target_property(ClangTidy_SRCS_TMP_CORE conky_core SOURCES)
|
|
|
|
list(APPEND ClangTidy_SRCS_TMP ${ClangTidy_SRCS_TMP_CORE})
|
2018-05-12 23:26:31 +00:00
|
|
|
endif()
|
2019-02-23 19:40:34 +00:00
|
|
|
|
2021-01-24 00:22:47 +00:00
|
|
|
foreach(TMP_SRC ${ClangTidy_SRCS_TMP})
|
2019-02-23 19:40:34 +00:00
|
|
|
if("${TMP_SRC}" MATCHES ".*\.cc|.*\.hh|.*\.[chi]pp|.*\.[chi]xx|.*\.ii")
|
2021-01-24 00:22:47 +00:00
|
|
|
list(APPEND ClangTidy_SRCS ${conky_SRC_DIR}/${TMP_SRC})
|
2019-02-23 19:40:34 +00:00
|
|
|
endif()
|
|
|
|
endforeach(TMP_SRC)
|
|
|
|
|
|
|
|
get_target_property(CLANG_INCLUDES_tmp conky INCLUDE_DIRECTORIES)
|
|
|
|
foreach(TMP_INCLUDE ${CLANG_INCLUDES_tmp})
|
|
|
|
list(APPEND CLANG_INCLUDES -I${TMP_INCLUDE})
|
|
|
|
endforeach(TMP_INCLUDE)
|
|
|
|
|
|
|
|
add_custom_target(clang-tidy
|
2021-01-24 00:22:47 +00:00
|
|
|
COMMAND ${ClangTidy_BIN} -config='' -fix -format-style=file
|
|
|
|
${ClangTidy_SRCS}
|
2019-02-23 19:40:34 +00:00
|
|
|
-- -std=c++17 -I${CMAKE_BINARY_DIR} ${CLANG_INCLUDES})
|
|
|
|
add_custom_target(check-clang-tidy
|
2021-01-24 00:22:47 +00:00
|
|
|
COMMAND ${ClangTidy_BIN} -config='' -format-style=file
|
|
|
|
${ClangTidy_SRCS}
|
2019-02-23 19:40:34 +00:00
|
|
|
-- -std=c++17 -I${CMAKE_BINARY_DIR} ${CLANG_INCLUDES})
|