Revert cmake simplification due to possible TravisCI problems.