[CMake] dll not found in test app for library within visual studio solution (Windows)

Bill Hoffman bill.hoffman at kitware.com
Mon Jun 25 15:31:02 EDT 2012


Bottom line is that Windows does not have an RPATH equivalent.   There 
is no way to embed a search path into an executable like there is on 
Linux/Unix.  Windows has a very simple search algorithm for dll's:

1. Is it in the same directory as the running .exe
2. Is it in the PATH

So, you can use RUNTIME_OUTPUT_DIRECTORY to make sure that all the .dll 
and .exe files for a project are in the same directory, or you can set 
the PATH.

-Bill


More information about the CMake mailing list