Hi,
I am trying to use googletest tests on Windows that need external Qt DLLs.
So I tried:
gtest_discover_tests ( ${targetName}UnitTests
TEST_PREFIX ${targetName}.
PROPERTIES
ENVIRONMENT_MODIFICATION
"PATH=path_list_prepend:${QT_RUNTIME_DIR}"
DISCOVERY_MODE PRE_TEST )
However, the environment modification is not honored when running the test discovery.
My alternative is to use configure_file()
to create a RunTest.bat
that sets up the environment and set the CROSSCOMPILING_EMULATOR property on the executable. This is a lot slower, looks like a hack and thus I would like to avoid that.
I cannot modify the environment outside of the cmake/ctest call because that clumsy, error-prone and also Visual Studio with the RUN_TESTS target is involved.
I do no want to copy the Qt DLLs to the output directory because this also involves plugins and other data, consumes lots of disk space and should not be necessary.
Any ideas? File a bug?
Hendrik