Fix CMake build. Patch from Ingmar Vanhassel.