Check Cmake version and use add_definitions accordingly.

This closes #5.