Setting CMAKE_CXX_CPPLINT have no effect on Visual Studio
I am on Visual Studio 2017, Windows 10. Below is the minimal code to recreate the situation
CMakeLists.txt
cmake_minimum_required(VERSION 3.11)
project(sample)
add_executable(${PROJECT_NAME} main.cpp)
main.cpp
int main() {
return 0;
}
After cmake -A x64 "-DCMAKE_CXX_CPPLINT=cpplint.exe" ..
, no matter I build it inside Visual Studio or build it in the terminal with msbuild, no cpplint related information showed up. I am expecting something like the below
Warning: cpplint diagnostics:
C:\test\build\main.cpp:0: No copyright message found. You should have a line: "Copyright [year] <Copyright Owner>" [legal/copyright] [5]
which shows correctly on linux. I also verified cpplint is installed correctly, if I open the terminal and type cpplint.exe -h
, the help information pops up correctly. Why does CMAKE_CXX_CPPLINT
seems to be not working in Visual Studio?