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
Are there any disadvantages to that? There are also currently a lot of test targets that are simply named “test” from “test.cpp” in different folders…
They’d have to have different CMake target names anyways, so I’d suggest naming their binaries using the CMake target name.