Some cmake improvments to speed up the build process

Change-Id: I66f9be3295aa2adc94697b8deb3dfbd666f178a2