CMake: add the custom buildtests target only once

Make BUILDTESTS_ADDED a global property, so the `buildtests` target gets added only once. As far as I understood, this seems to fulfil the requirements of CMP0002.

Bug #103003
1 file changed