Rewrite cmake scripts to enforce dependency-policies

Trying to depend on a package you should not depend on, should result in a compile error.

May require some changes in the way headers are included. And while we are at it, the cmake files could use a general cleanup.

(RM-20 from redmine: created on 2011-08-06 by Lukasz Gromanowski, )

Edited by redmine