cmake: fix static library checking