Fix bug in CmakeLists.txt, add definitions for cmake