used cmake; fixed code for gcc

Change-Id: I12bdde53eab9ab4764d18b8e7c7d091ba3174eb9
(tmp) compressed revision text

Change-Id: Ie4c9f9e57ca9707bed193682afd0c0cf3caaa376