Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make cmake submodule update work with older versions of git #2490

Merged
merged 1 commit into from
Jan 24, 2022

Conversation

johnomotani
Copy link
Contributor

In older versions of git submodule update --init --recursive had to be run from the root of the repo. This PR replaces CMAKE_CURRENT_SOURCE_DIR with PROJECT_SOURCE_DIR in the cmake call to update the submodules to ensure that the update runs from the repo root, making it compatible with older git versions.

Before this fix, a CMake build with a too-old version of git would error with a message like

You need to run this command from the toplevel of the working tree.
CMake Error at CMakeLists.txt:47 (message):
  git submodule update --init failed with 1, please checkout submodules
Call Stack (most recent call first):
  tests/unit/CMakeLists.txt:1 (bout_update_submodules)


-- Configuring incomplete, errors occurred!

In older versions of git `submodule update --init --recursive` had to be
run from the root of the repo. This commit replaces
`CMAKE_CURRENT_SOURCE_DIR` with `PROJECT_SOURCE_DIR` in the cmake call
to update the submodules to ensure that the update runs from the repo
root, making it compatible with older git versions.
@johnomotani johnomotani added bugfix build-system issues with make/configure/... labels Jan 24, 2022
@johnomotani johnomotani merged commit 0670b4d into master Jan 24, 2022
@johnomotani johnomotani deleted the cmake-submodules-fix branch January 24, 2022 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix build-system issues with make/configure/...
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants