cpp-best-practices / gui_starter_template

A template CMake project to get you started with C++ and tooling

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove explicit reference to imgui in CMake StaticAnalysis module

salvioli opened this issue · comments

The CMake module StaticAnalyzers.cmake IMHO should be as source independent as possible, currently, it has a reference to imgui/lib folder.

If I'm not mistaken, the CMake code that references imgui points to a folder that doesn't exist.

Here's the relevant code in StaticAnalyzers.cmake:
https://github.com/cpp-best-practices/cpp_starter_project/blob/a533e78ba2a34178cf05078d801ed61464e806e0/cmake/StaticAnalyzers.cmake#L8-L15

According to the cppcheck manpage, -i <dir> means "ignore the path <dir>". The variable CMAKE_SOURCE_DIR points to "the path to the top level of the source tree", and there is no "imgui" folder at the top level. As far as I can tell, the whole -i ${CMAKE_SOURCE_DIR}/imgui/lib argument serves no purpose and should be removed, whether you're using imgui libraries or not.

Am I missing something?

FWIW, I think you are right, I believe that this is just a leftover from refactoring and should be removed. And in any case any ignore to be injected should be done via function parameters.