First attempt to make it possible to build CasADi as dlls on windows

Well, second attempt actually, this is a new version of #846 against the `develop` branch.

When building a dll on windows, it seems that the linker requires all the dependencies of the dll to be available. (Unlike on linux, where the linker is happy to leave dependencies unresolved until the shared lib is linked into an actual program).

This patch adds a number of such dependencies to the build scripts, and rearranges the order of `add_subdirectory` invocations to respect them. With this patch, I am able to build CasADi as dlls on windows with msys, using

    cmake -G "MSYS Makefiles" .. -DENABLE_SHARED=ON -DENABLE_STATIC=OFF

There's probably a number of other dependencies that I have missed, since they are not needed in my current CasADi configuration. Still, I hope that you can accept this pull request as a start.

There is also a small fix not to build qpOASES if BLAS is not found.