I did not get the downloaded 4.8.0 opencv to work, but I did not try very hard. 
Forgot to mention that this was not gcc version 13 but a much earlier version so cmake was not the problem.