0

After I installed the CLion. I used brew install llvm@7 and installed successfully.

The CMake options is set as

-DCMAKE_BUILD_TYPE=Debug
-DLLVM_DIR=/usr/local/Cellar/llvm@/7.0.1/lib/cmake/llvm/
..

And the path for Clang-Tidy is also correct.

/usr/local/Cellar/llvm@7/7.0.1/bin/clang-tidy

the path of Clang-Tidy

However it still occurs with error 'Clang-Tidy not found'

if(NOT CLANG_TIDY_EXECUTABLE) message(FATAL_ERROR "clang-tidy not found") endif()

project

So what could be the reason that Clang-Tidy is not available? I need to use this because Clang-tidy is the linter that used in my course. (I'm new with CLion and CMake)

Thank you!

ripfreeworld
  • 143
  • 1
  • 13

1 Answers1

2

It doesn't seem that clang-tidy was installed in a standard location searched by find_program()? Try setting CMAKE_PROGRAM_PATH or CMAKE_APPBUNDLE_PATH.

https://cmake.org/cmake/help/v3.14/command/find_program.html

fdk1342
  • 3,274
  • 1
  • 16
  • 17