Fix Cmake function

Cmake function works correctly now