cmake fixes for windows dynamic library