Skip to content

Bug: GIT_SUBMODULES_RECURSE and GIT_SUBMODULES are ignored #467

Closed
@ethindp

Description

@ethindp

I have a CMake project that has private submodules. The project's CMake configuration process will acquire the public submodules that I need. Therefore, I've used the following git-related options:

    GIT_SUBMODULES ""
    GIT_SUBMODULES_RECURSE FALSE

According to the CMake documentation, with this set, FetchContent_Declare (and, by extension, ExternalProject_Add) will not clone submodules, as long as CMP0096 is set to NEW. So I did that at the top of my project:

cmake_policy(VERSION 3.25)
cmake_policy(SET CMP0096 NEW)

However, the arguments I set in CPMAddPackage (GIT_SUBMODULES and GIT_SUBMODULES_RECURSE) are ignored, and all submodules are cloned anyway. Is this a bug in CPM? Logically this should work perfectly fine, but it isn't for some reason.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions