I am currently having trouble changing the directory CTest in when using the RUN_TESTS project generated by CMake. Currently CMAKE_RUNTIME_OUTPUT_DIRECTORY is set to a custom path. As a result when CTest attempts to run, it is doing so from a directory that contains no binaries.
As a temporary workaround I am calling ADD_TEST using ${RUNTIME_OUTPUT_DIRECTORY}\test but I am not sure if this is the correct solution. Is there a way a better way change the default directory used by CTest?
If your ADD_EXECUTABLE target is say my_exe and your test name my_test, you should be able to call ADD_TEST like:
ADD_TEST(NAME my_test COMMAND my_exe)
For further info, run
cmake --help-command ADD_TEST
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With