How to copy DLL files into the same folder as the executable using CMake?
I’d use add_custom_command to achieve this along with cmake -E copy_if_different…. For full info run cmake –help-command add_custom_command cmake -E So in your case, if you have the following directory structure: /CMakeLists.txt /src /libs/test.dll and your CMake target to which the command applies is MyTest, then you could add the following to your CMakeLists.txt: add_custom_command(TARGET … Read more