Added Cut function
Merge pull request #1 from 5263/buildimprovements

fixes in cmake files