We consider a multi-compartment evolutionary model representing growth, mutation and migration of cancer cells, as well as the effect of drugs, and we design optimal switching targeted cancer therapies where a single drug, or suitable drug combination, is given at each time so as to minimise not only the overall tumor size over a finite horizon, but also drug-provoked side effects. The strong diagonally- dominant structure of the model allows to solve the problem via convex optimisation. We provide an algorithm that yields optimality throughout the whole treatment duration by solving the convex optimisation problem with different horizons, and show how dwell time can be enforced via heuristics. Also the optimal treatment duration can be computed via convex optimisation. The proposed approaches are applied to a model of ALK-rearranged lung carcinoma.