Fix for new version of cmake
Removed unnecessary list(LENGTH ...)
Merge pull request #4013 from Atlante45/cmake_fix

Fix for new version of cmake