Skip to content

[Feature Request] a SetupHunter option to just download the latest HunterGate module #357

Description

@Lucide

Hunter offers an automated setup powered by a single FetchContent, which is a really convenient way to keep the gate itself up to date. The major side-effect of this approach is that it enforces a declarative approach which heavily limits the versatility (and locality) of the project dependencies logic.

  • The major drawback is that the hunter_config() and hunter_add_package() functions aren't available anymore. This prevents the project's dependencies logic to take advantage of natural CMake features like add_subdirectory() and localized scope.
  • Unavailable data: sometimes all information that can affect dependencies is simply not available before evaluating any further code. This includes targets, target properties, or subdirectory-specific data.
  • Global scope pollution: variables that should belong to a subdirectory only must be moved up to the root CMakeLists.txt file.
  • Duplicated conditional logic (splitted if() branches): optional operations dependent on the same condition need to be split between "dependencies-affecting operations" and "other operations". This leads to duplicated code and potential errors.

On the other hand, detecting and downloading the latest "classic" hunter gate is not a trivial operation to do in CMake, especially if done properly: already existing hunter setup code should be preferred to a custom one.

My proposal is to add an option like HUNTER_DOWNLOAD_ONLY to disable everything beyond the latest hunter gate download, and let users use it as described in the docs.

I hope I made sense and made no blunders 😅.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions