Unbreak cmake build with shared libraries enabled.