[CMake] Lint Integration

Alexander Neundorf a.neundorf-work at gmx.net
Tue Sep 30 18:42:54 EDT 2008


On Wednesday 17 September 2008, Matthias.Goesswein at ecs.steyr.com wrote:
> Hi,
>
> I´d like to integrate PC-Lint (www.gimpel.com, a source code checker for
> C/C++) to my cmake build system
> (Cross-Compile for an embedded Power PC with WindRiver Compiler, which is
> running on Windows).
> My first idea was to add a command to CMAKE_C_COMPILE_OBJECT, but I don't
> know how to extract the include and definition command line options from
> <FLAGS> or <DEFINES>.:
>
> SET(CMAKE_C_COMPILE_OBJECT
>           "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -Wa,-l -o <OBJECT> -c
> <SOURCE>"
>           "${PCLINT_EXECUTABLE} +v -iC:\Lint std.lint <??Include and
> Definition Flags??> <SOURCE> )
>
> How could i do this (is there a possibility to make string manipulation?),
> or is there an other way to integrate lint?
> PC-Lint should check each c-File, which is compiled by the Compiler.

I would suggest using add_custom_target(), reuse the list of source files, and 
use get_directory_property ot get the current include dirs.


Alex


Alex


More information about the CMake mailing list