Allow compiling plugins using cmake

Change-Id: Iba5eb00454d33b430f8deef0fac552724a07d5a6