It seems that auto completion plugin of Codeblocks (version 12.11 and up) does not work very well with a cmake generated project.
One solution is to deactivate this plugin, another solution is to install an older version of Codeblocks (10.05), from [this page](http://sourceforge.net/projects/codeblocks/files/Binaries/10.05).