cmake: Minor refactor Minor refactor of build script for readability and diff-ability. Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>