Kind of, because while MS-DOS was compatible between PCs, CP/M depended pretty much on what 8 bit machine you had, and like UNIX required compilation from source for proper compatibility.
FTL Modula-2 for example, had several low level portability modules depending on which CP/M machine you were actually using.