Added dep to cmake to ensure visual studio solution file builds in the correct order
Fixed some dep issues in code