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

"Fetch Content" doesn't work because of catch2-src #1107

Closed
zafirovicmilan2 opened this issue Dec 13, 2022 · 3 comments · Fixed by #1121
Closed

"Fetch Content" doesn't work because of catch2-src #1107

zafirovicmilan2 opened this issue Dec 13, 2022 · 3 comments · Fixed by #1121

Comments

@zafirovicmilan2
Copy link

zafirovicmilan2 commented Dec 13, 2022

I tried to open "fetch_content" (opened CMakeLists.txt from "fetch_content") and cmake configuration failed because it cannot fetch "catch2-src":

fatal: No url found for submodule path 'tests/_deps/catch2-src' in .gitmodules
CMake Error at sqliteorm-subbuild/sqliteorm-populate-prefix/tmp/sqliteorm-populate-gitclone.cmake:62 (message):
  Failed to update submodules in:
  '/home/zafirovicmilan2/Downloads/build-fetch_content-Desktop_Qt_6_4_1_gcc-Debug/_deps/sqliteorm-src'

cmake 3.25.1
g++/gcc 11.3.0

@rotolof
Copy link
Contributor

rotolof commented Dec 14, 2022

It seems to be a dangling submodule path that has no entry in .gitmodules.
@fnc12 I think it can be fixed in the repo with git rm --cached tests/_deps/catch2-src.

@zafirovicmilan2 A quick fix for you is pass the GIT_SUBMODULES parameter with an empty string to FetchContent:

FetchContent_Declare(
  sqlite_orm
  GIT_REPOSITORY https://github.com/fnc12/sqlite_orm.git
  GIT_TAG v1.8
  GIT_SUBMODULES ""
)

firedaemon-cto pushed a commit to FireDaemon/sqlite_orm that referenced this issue Jan 16, 2023
@trueqbit
Copy link
Collaborator

@zafirovicmilan2 Does PR #1121 (into dev) or the v1.8.1 release solve the problem?

@rotolof
Copy link
Contributor

rotolof commented Feb 13, 2023

@trueqbit I'm using v1.8.1, it does solve the issue (at least for me).

I'm using the following code in my CMakeLists.txt:

  FetchContent_Declare(
    sqlite_orm
    GIT_REPOSITORY https://github.com/fnc12/sqlite_orm.git
    GIT_TAG v1.8.1
    GIT_SHALLOW true
  )

@trueqbit trueqbit linked a pull request Feb 13, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants