Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
CMake
CMake
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,296
    • Issues 3,296
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 9
    • Merge Requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • External Wiki
    • External Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #21527

Closed
Open
Created Nov 30, 2020 by Maarten@madebrContributor

Add CMAKE_REQUIRE_FIND_PACKAGE_<PackageName> variable

We currently have the variable CMAKE_DISABLE_FIND_PACKAGE_<PackageName> that disabled every (optional) find_package(PackageName).

I think it would be interesting to also introduce a CMAKE_REQUIRE_FIND_PACKAGE_<PackageName> variable. This would logically transform every find_package(XXX) into find_package(XXX REQUIRED).

Enabling both CMAKE_DISABLE_FIND_PACKAGE_XXX and CMAKE_REQUIRE_FIND_PACKAGE_XXX should be an error.

This variable would be interesting to make sure that a dependency is found (and used). Right now, a lot of cmake scripts are very flexible in that they optionally enable features when finding some dependency. This requires the packager checking the configure logs and/or running tests to check whether a feature is actually enabled.

With CMAKE_REQUIRE_FIND_PACKAGE_<PackageName>, you have greater assurance that when the configure step succeeded, that the dependency has been found. (You should still test though)

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None