[CMake] Improve FindGMP (#8846)
Fixes #8792. This commit fixes issues with/improves our current
implementation of FindGMP:
- Version check that does not rely on regex matches in `gmp.h`. Instead,
this commit uses a test program that checks at compile-time whether
the GMP version is recent enough. This is more robust, because on some
systems (such as Fedora), `gmp.h` includes another file that has that
version information.
- It now also checks for the `gmpxx.h` header and the `gmpxx` library.
- The commit changes the compile test to use the include directories and
libraries that were found using `find_path` and `find_library`.