Mercurial > malikania
changeset 90:58b43650d8f0
CMake: vera++ must check source files only, closes #633
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sun, 19 Feb 2017 19:42:02 +0100 |
parents | 0bedc450a9d2 |
children | 79a2a75ca091 |
files | cmake/function/MalikaniaVeraCheck.cmake |
diffstat | 1 files changed, 14 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/cmake/function/MalikaniaVeraCheck.cmake Sun Feb 05 20:03:59 2017 +0100 +++ b/cmake/function/MalikaniaVeraCheck.cmake Sun Feb 19 19:42:02 2017 +0100 @@ -32,10 +32,23 @@ function(malikania_vera_check target sources) if (WITH_VERA) + set(valid ".cpp;.c;.hpp;.h") + + # Cleanup non relevant files. + foreach (s ${sources}) + get_filename_component(ext ${s} EXT) + + foreach (e ${valid}) + if (${ext} STREQUAL ${e}) + list(APPEND newsources ${s}) + endif () + endforeach () + endforeach () + add_custom_command( TARGET ${target} COMMAND - ${VERA_EXECUTABLE} -w --root ${CMAKE_SOURCE_DIR}/vera ${sources} + ${VERA_EXECUTABLE} -w --root ${CMAKE_SOURCE_DIR}/vera ${newsources} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} VERBATIM )