I\'m tasked with building python bindings for a c++-based project (using swig). The project uses cmake to build and ctest to test and the build and test of the bindings are
Craig Scott already provided a great solution via ENVIRONMENT test properties. I just want to add how this works on Windows with the Visual Studio generator and generator expressions:
set_tests_properties(
name_of_test_one
name_of_test_two
PROPERTIES
# Make sure DLL is found by adding its directory to PATH
ENVIRONMENT "PATH=$\;$ENV{PATH}"
)
Note 1: Instead of a colon, use an escaped semi-colon Note 2: I'm using the more flexible $ generator expression