For Debian the rules file is the main makefile and assuming that a upstream
makefile will mangle the Debian packaging files creates false alerts
from static analysis tools and other problems.
Fix all cmake tests (including plugin) to use
MY_CHECK_AND_SET_COMPILER_FLAG. And fix that function
to be compatible with cmake 3.0. This way flag checks
are correctly cached (even in cmake 3.0) and properly reused.