mingw|cmake fixes

- This patch simplifes the static|shared switch by using the standard BUILD_SHARED_LIBS:
http://cmake.org/cmake/help/v2.8.12/cmake.html#variable:BUILD_SHARED_LIBS

- Also the dll was installed in the /lib, which is incorrect, it should go to the runtime dir.