fixing cmake dependency order so that the link of static libraries is also in the correct order