used cmake; fixed code for gcc

Change-Id: I12bdde53eab9ab4764d18b8e7c7d091ba3174eb9