fix cmake scripts and make zmq optional