Add CMake tests.

Task-number: QTBUG-41445
Change-Id: Ia3b903aa41d5b8c5de72e9a31ccd37b222e72b5c
Reviewed-by: Stephen Kelly <steveire@gmail.com>