Small cmakeutils refactoring
Removed duplicated code Improved function name, to better map what it does