Add static linkage in cmake