Fix doc build

- turn the _add_doxy_headers macro into a no-op if -DNO_DOC is used
  so it doesn't cause problems

- moved the -DNO_DOC conditional into the top CMakeLists file, following
  pattern with other override flags