Modified cmake for optional leap support