To wrap a library build by cmake, I tried different ways.
One idea is, a `genrule` triggers cmake to do all dirty work, and a `cc_library` makes a bazel target.
`genrule` creates different kinds of files altogether. Is it possible to cherrypick some of them in another rule?
Here is an approach:
```
cc_library(
name = "foo",
srcs = [
f
for f in ":cmake_build_foo"
if f.endswith(".a")
], # only ".a" files
hdrs = [
f
for f in ":cmake_build_foo"
if f.endswith(".h")
], # only headers
linkstatic = 1,
deps = [
":cmake_build_foo",
],
)
genrule(
name = "cmake_build_foo",
outs = [
"libfoo_static.a",
"foo.h",
],
cmd = "use cmake to build the whole library",
)
```
Thanks.