[cmake,release] Corrects setting of HAVE_* variables.

For generating the config.h file we use the HAVE_* variables instead
of the CMake ones *_FOUND, Unfortunately, we sometines to not set
HAVE_* to the value of the *_FOUND vriable but to its name. Usually
we only query whether these variable are set at all. While
this often (except for psurface) does not pose a problem, it is semantically
wrong. Therfore this patch fixes this.

Kudos to Ansgar for pointing to this problem.
[cmake,bugfix] Fixes traversal of subdirs for make all.

Previously, if test was not the last entry in the list of subdirectories
then all subdirectories that were listed after test were con processed
during all and install. This patch fixes this behaviour.