Parent post is well stated.
There really is no benefit to becoming adversarial or doing anything to undermine the future success of the project. And there are many possible down sides, including your rep within that company and your broader rep.
Continue to provide them the best value you can. It sounds like right now that value might be to advise them on the level of complexity of their codebase and the level of talent and experience needed to maintain and continue development on it. Even if that doesn't change their minds, you are on record with your attempts to help them steer a better course. And then, whatever their decision, do the best you can to transition knowledge and prepare the new guy for success.
If you leave with them knowing that you did everything you could to help them make good decisions, and you did everything you could to help them be successful given the decisions that they made, they'll be much more likely to call you for the next project. Or maybe the CTO will call you when he finds a challenging project at his next company. If you help people out, even when there is no angle for you, and create a history of doing this, you'll find that people want to work with you and there are more opportunities coming your way.
If you burn these guys, and do it again somewhere else, and create a history of that, you'll eventually find that people don't want to work with you.
Building a good rep and a network of people who recognize your value and enjoy working with you is a long-term investment worth making.