mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-02-09 15:38:38 +00:00
Rename cmake vars to suppress warnings.
This commit is contained in:
parent
283129e283
commit
2e6b3bdb8e
@ -1,21 +1,21 @@
|
|||||||
# Find Clang format
|
# Find Clang format
|
||||||
#
|
#
|
||||||
|
|
||||||
set(CLANG_FORMAT_BIN_NAME
|
set(ClangFormat_BIN_NAME
|
||||||
clang-format
|
clang-format
|
||||||
clang-format-5.0
|
clang-format-5.0
|
||||||
clang-format-6.0
|
clang-format-6.0
|
||||||
clang-format-7
|
clang-format-7
|
||||||
clang-format-8)
|
clang-format-8)
|
||||||
|
|
||||||
find_program(CLANG_FORMAT_BIN NAMES ${CLANG_FORMAT_BIN_NAME})
|
find_program(ClangFormat_BIN NAMES ${ClangFormat_BIN_NAME})
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
find_package_handle_standard_args(CLANG_FORMAT DEFAULT_MSG CLANG_FORMAT_BIN)
|
find_package_handle_standard_args(ClangFormat DEFAULT_MSG ClangFormat_BIN)
|
||||||
|
|
||||||
mark_as_advanced(CLANG_FORMAT_BIN)
|
mark_as_advanced(ClangFormat_BIN)
|
||||||
|
|
||||||
if(CLANG_FORMAT_FOUND)
|
if(ClangFormat_FOUND)
|
||||||
# A CMake script to find all source files and setup clang-format targets for
|
# A CMake script to find all source files and setup clang-format targets for
|
||||||
# them
|
# them
|
||||||
include(clang-format)
|
include(clang-format)
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
# Find Clang tidy
|
# Find Clang tidy
|
||||||
#
|
#
|
||||||
|
|
||||||
set(CLANG_TIDY_BIN_NAME
|
set(ClangTidy_BIN_NAME
|
||||||
clang-tidy
|
clang-tidy
|
||||||
clang-tidy-5.0
|
clang-tidy-5.0
|
||||||
clang-tidy-6.0
|
clang-tidy-6.0
|
||||||
clang-tidy-7
|
clang-tidy-7
|
||||||
clang-tidy-8)
|
clang-tidy-8)
|
||||||
|
|
||||||
find_program(CLANG_TIDY_BIN NAMES ${CLANG_TIDY_BIN_NAME})
|
find_program(ClangTidy_BIN NAMES ${ClangTidy_BIN_NAME})
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
find_package_handle_standard_args(CLANG_TIDY DEFAULT_MSG CLANG_TIDY_BIN)
|
find_package_handle_standard_args(ClangTidy DEFAULT_MSG ClangTidy_BIN)
|
||||||
|
|
||||||
mark_as_advanced(CLANG_TIDY_BIN)
|
mark_as_advanced(ClangTidy_BIN)
|
||||||
|
|
||||||
if(CLANG_TIDY_FOUND)
|
if(ClangTidy_FOUND)
|
||||||
# A CMake script to find all source files and setup clang-tidy targets for
|
# A CMake script to find all source files and setup clang-tidy targets for
|
||||||
# them
|
# them
|
||||||
include(clang-tidy)
|
include(clang-tidy)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
set(CLANG_FORMAT_CXX_FILE_EXTENSIONS
|
set(ClangFormat_CXX_FILE_EXTENSIONS
|
||||||
${CLANG_FORMAT_CXX_FILE_EXTENSIONS}
|
${ClangFormat_CXX_FILE_EXTENSIONS}
|
||||||
*.cpp
|
*.cpp
|
||||||
*.h
|
*.h
|
||||||
*.cxx
|
*.cxx
|
||||||
@ -9,19 +9,19 @@ set(CLANG_FORMAT_CXX_FILE_EXTENSIONS
|
|||||||
*.hh
|
*.hh
|
||||||
*.ipp)
|
*.ipp)
|
||||||
|
|
||||||
foreach(PATTERN ${CLANG_FORMAT_CXX_FILE_EXTENSIONS})
|
foreach(PATTERN ${ClangFormat_CXX_FILE_EXTENSIONS})
|
||||||
list(APPEND CLANG_FORMAT_CXX_PATTERN ${CMAKE_SOURCE_DIR}/src/${PATTERN})
|
list(APPEND ClangFormat_CXX_PATTERN ${CMAKE_SOURCE_DIR}/src/${PATTERN})
|
||||||
list(APPEND CLANG_FORMAT_CXX_PATTERN ${CMAKE_SOURCE_DIR}/tests/${PATTERN})
|
list(APPEND ClangFormat_CXX_PATTERN ${CMAKE_SOURCE_DIR}/tests/${PATTERN})
|
||||||
list(APPEND CLANG_FORMAT_CXX_PATTERN ${CMAKE_SOURCE_DIR}/lua/${PATTERN})
|
list(APPEND ClangFormat_CXX_PATTERN ${CMAKE_SOURCE_DIR}/lua/${PATTERN})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
file(GLOB_RECURSE CLANG_FORMAT_SRCS ${CLANG_FORMAT_CXX_PATTERN})
|
file(GLOB_RECURSE ClangFormat_SRCS ${ClangFormat_CXX_PATTERN})
|
||||||
|
|
||||||
add_custom_target(clang-format
|
add_custom_target(clang-format
|
||||||
COMMAND ${CLANG_FORMAT_BIN} -style=file -i
|
COMMAND ${ClangFormat_BIN} -style=file -i
|
||||||
${CLANG_FORMAT_SRCS})
|
${ClangFormat_SRCS})
|
||||||
add_custom_target(check-clang-format
|
add_custom_target(check-clang-format
|
||||||
COMMAND ${CMAKE_SOURCE_DIR}/bin/run-clang-format.py
|
COMMAND ${CMAKE_SOURCE_DIR}/bin/run-clang-format.py
|
||||||
--color always
|
--color always
|
||||||
--clang-format-executable ${CLANG_FORMAT_BIN}
|
--clang-format-executable ${ClangFormat_BIN}
|
||||||
${CLANG_FORMAT_SRCS})
|
${ClangFormat_SRCS})
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
get_target_property(CLANG_TIDY_SRCS_TMP conky SOURCES)
|
get_target_property(ClangTidy_SRCS_TMP conky SOURCES)
|
||||||
get_target_property(conky_SRC_DIR conky SOURCE_DIR)
|
get_target_property(conky_SRC_DIR conky SOURCE_DIR)
|
||||||
|
|
||||||
if(BUILD_TESTS)
|
if(BUILD_TESTS)
|
||||||
get_target_property(CLANG_TIDY_SRCS_TMP_CORE conky_core SOURCES)
|
get_target_property(ClangTidy_SRCS_TMP_CORE conky_core SOURCES)
|
||||||
list(APPEND CLANG_TIDY_SRCS_TMP ${CLANG_TIDY_SRCS_TMP_CORE})
|
list(APPEND ClangTidy_SRCS_TMP ${ClangTidy_SRCS_TMP_CORE})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
foreach(TMP_SRC ${CLANG_TIDY_SRCS_TMP})
|
foreach(TMP_SRC ${ClangTidy_SRCS_TMP})
|
||||||
if("${TMP_SRC}" MATCHES ".*\.cc|.*\.hh|.*\.[chi]pp|.*\.[chi]xx|.*\.ii")
|
if("${TMP_SRC}" MATCHES ".*\.cc|.*\.hh|.*\.[chi]pp|.*\.[chi]xx|.*\.ii")
|
||||||
list(APPEND CLANG_TIDY_SRCS ${conky_SRC_DIR}/${TMP_SRC})
|
list(APPEND ClangTidy_SRCS ${conky_SRC_DIR}/${TMP_SRC})
|
||||||
endif()
|
endif()
|
||||||
endforeach(TMP_SRC)
|
endforeach(TMP_SRC)
|
||||||
|
|
||||||
@ -18,10 +18,10 @@ foreach(TMP_INCLUDE ${CLANG_INCLUDES_tmp})
|
|||||||
endforeach(TMP_INCLUDE)
|
endforeach(TMP_INCLUDE)
|
||||||
|
|
||||||
add_custom_target(clang-tidy
|
add_custom_target(clang-tidy
|
||||||
COMMAND ${CLANG_TIDY_BIN} -config='' -fix -format-style=file
|
COMMAND ${ClangTidy_BIN} -config='' -fix -format-style=file
|
||||||
${CLANG_TIDY_SRCS}
|
${ClangTidy_SRCS}
|
||||||
-- -std=c++17 -I${CMAKE_BINARY_DIR} ${CLANG_INCLUDES})
|
-- -std=c++17 -I${CMAKE_BINARY_DIR} ${CLANG_INCLUDES})
|
||||||
add_custom_target(check-clang-tidy
|
add_custom_target(check-clang-tidy
|
||||||
COMMAND ${CLANG_TIDY_BIN} -config='' -format-style=file
|
COMMAND ${ClangTidy_BIN} -config='' -format-style=file
|
||||||
${CLANG_TIDY_SRCS}
|
${ClangTidy_SRCS}
|
||||||
-- -std=c++17 -I${CMAKE_BINARY_DIR} ${CLANG_INCLUDES})
|
-- -std=c++17 -I${CMAKE_BINARY_DIR} ${CLANG_INCLUDES})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user