Configure cmake to compile everything in a lib and compile test