cmake: some cleanup of linking parameters

when building the tests, we don't need to link to gtest in the examples