Require CMake 2.8.11 everywhere
Refactor copy/pasted CMake code to function

Fixes #193