Instead of adding all this stuff to .gitignore, you should be building everything in a subfolder, like this:

```
mkdir build
cd build
cmake ../
```