Update to the cmake script to copy dependencies into packages
This should make the logic more robust in windows