gtest_discover_tests does not honor environment property when running the test executable with the --gtest-list-tests command
The gtest_discover_tests function does not work on Windows whenever the test executable has some dependency on a shared library because it is currently not possible to set the environment path for the call to the test executable with the --gtest-list-tests command. The test executable will get built but the final step of calling the test executable with the --gtest-list-tests command will fail, causing the ctests to not get generated and the overall build to fail. This is not an issue on Linux because the rpath is set on the test executable and the shared libraries are found.