adding WITH_DOC parameter to cmake

Fixes #412
Merge pull request #423 from hefee/master

adding WITH_DOC parameter to cmake