Add a compileTestWithPkgConfig helper function to configure

... and use it with the opengl compile tests.

Change-Id: I402574be332e41c721a758e63a233d193224f16b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>