[cmake] Fix warnings.
See http://www.cmake.org/Bug/view.php?id=14441
Merge pull request #983 from matthias-kuhn/cmake-warning-fix

[cmake] Fix warnings.