cmake: Fix warning suppression for googletest build
In commit
27e9d563, we attempted to disable deprecated warnings when building
googletest, but the implementation contained two errors:
1. The `set_property()` call occurred before adding the target directory,
making it impossible to set properties on non-existent objects.
2. The `-Wno-deprecated-declarations` flag was incorrectly passed as an
`APPEND` argument instead of a `PROPERTY` argument.
This caused build failures with libstdc++-12 and newer Clang versions:
```
CMake Error at src/CMakeLists.txt:772 (set_property):
set_property given invalid argument "-Wno-deprecated-declarations".
```
This commit fixes both issues by:
- Moving the `set_property()` call after `add_subdirectory()`
- Correctly passing the warning flag as a `PROPERTY` argument
Signed-off-by: Kefu Chai <tchaikov@gmail.com>