File: LinterSetup.cmake

package info (click to toggle)
python-gsd 4.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,152 kB
  • sloc: python: 3,255; ansic: 1,965; cpp: 129; makefile: 14
file content (21 lines) | stat: -rw-r--r-- 520 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
include(FindPackageMessage)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# http://www.mariobadr.com/using-clang-tidy-with-cmake-36.html
find_program(
    CLANG_TIDY_EXE
    NAMES "clang-tidy"
    DOC "Path to clang-tidy executable"
)
if(CLANG_TIDY_EXE)
    find_package_message(
        CLANG_TIDY
        "Found clang-tidy: ${CLANG_TIDY_EXE}"
        "[${CLANG_TIDY_EXE}]"
    )
    set(DO_CLANG_TIDY
        "${CLANG_TIDY_EXE}"
        "-p=${CMAKE_BINARY_DIR}"
        "-header-filter=^${CMAKE_SOURCE_DIR}/.*"
    )
endif()