The cmake-lint program will check your listfiles for style violations, common mistakes, and anti-patterns.
cmake-lint