Also contains some other miscellaneous CMake cleanups.
Tested well enough on the CMB side.
Do: merge
merged
mentioned in commit a41fb721