I have a working build and test set up on Linux (yay!) but Windows continues to pose challenges. Everything builds fine, but all tests fail with “MyProj.dll” not found!
I suppose this is because they are in different directories. Is there some CMake-approved way to make sure that MyProj.dll’s path is in the PATH of the tests (some of which need to have the usual system PATH intact)? Or is there a better way to help my test executables find the DLL?
I’d place your test binaries in the same place as your DLLs with the CMAKE_RUNTIME_OUTPUT_DIRECTORY variable (which defaults the per-target RUNTIME_OUTPUT_DIRECTORY property).