Harmonic maps from surfaces to complex projective spaces and certain Lie groups