Probably I was not clear in the original question. The issue is if I change googletest cmake to support shared library by:
EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON"
The header file is not included in the SDK image.
Turns out we have to change RDEPENDS_${PN}-dev += "${PN}-staticdev" to
RDEPENDS_${PN}-dev += "${PN}-dev"
Thanks,
Lijun