[CMake template] Fix compilation errors.