[CMake] properly handle submodule codes in release tarball
When release tarballs are made on gitlab/github. The submodule external repositories are not added and thus CMake cannot be used. Need a solution with the following desired characteristics.
- better to use consistent source code as configure
- gitlab, github or manually created tarball agnostic.