Re-Revert "Merge pull request #567 from MarcWeber/submit/cmake-improvement"

This reverts commit b08e12b37ae9470c9d8eb8438c21adb8ddbae19e.