even more cmake fixes
Merge pull request #8013 from ricardoquesada/more_cmake_fixes

even more cmake fixes