--- CMake/common/CppcheckTargets.cmake.orig 2014-10-03 15:04:16.000000000 +0200 +++ CMake/common/CppcheckTargets.cmake 2014-12-20 18:25:39.845494349 +0100 @@ -83,6 +83,7 @@ get_target_property(_cppcheck_sources "${_name}" SOURCES) set(_files) + if(_cppcheck_sources) foreach(_source ${_cppcheck_sources}) get_source_file_property(_cppcheck_lang "${_source}" LANGUAGE) get_source_file_property(_cppcheck_loc "${_source}" LOCATION) @@ -90,6 +91,7 @@ list(APPEND _files "${_cppcheck_loc}") endif() endforeach() + endif() if(NOT _files) # nothing to check return() --- CMake/common/CpplintTargets.cmake.orig 2014-10-03 15:04:16.000000000 +0200 +++ CMake/common/CpplintTargets.cmake 2014-12-20 17:39:11.122277997 +0100 @@ -82,6 +82,7 @@ get_target_property(_cpplint_sources "${_name}" SOURCES) set(_files) #set(_exclude_pattern ".*moc_.*\\.cxx|Buildyard/Build") + if(_cpplint_sources) foreach(_source ${_cpplint_sources}) get_source_file_property(_cpplint_lang "${_source}" LANGUAGE) get_source_file_property(_cpplint_loc "${_source}" LOCATION) @@ -89,6 +90,7 @@ list(APPEND _files "${_cpplint_loc}") endif("${_cpplint_lang}" MATCHES "CXX" AND NOT ${_cpplint_loc} MATCHES ${add_cpplint_EXCLUDE_PATTERN}) endforeach(_source ${_cpplint_sources}) + endif() if(NOT _files) # nothing to check return() --- CMake/common/clangcheckTargets.cmake.orig 2014-10-03 15:04:16.000000000 +0200 +++ CMake/common/clangcheckTargets.cmake 2014-12-20 13:41:11.706210588 +0100 @@ -40,6 +40,7 @@ set(_exclude_pattern ".*moc_.*\\.cxx$") # Qt moc files get_target_property(_clangcheck_sources "${_name}" SOURCES) + if(_clangcheck_sources) set(_files) foreach(_source ${_clangcheck_sources}) get_source_file_property(_clangcheck_lang "${_source}" LANGUAGE) @@ -50,6 +51,7 @@ list(APPEND _files "${_clangcheck_loc}") endif() endforeach() + endif() if(NOT _files) # nothing to check return()