This way we can just use Graphs in find_package, but be able to
use either 3D or 2D, or both, when configuring the module.
Fixes: QTBUG-119920
Pick-to: 6.7
Change-Id: I5caa0692587d04492e3e27906d27e2d3d3b7a3cc
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>