You forgot add `RESULT_VARIABLE EXIT_CODE` to execute_process..

Do this:

```execute_process(COMMAND git clone ${remote} ${submodule_dir}
                              RESULT_VARIABLE EXIT_CODE)
```