cmake: add support for tests compiling