Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,926
    • Issues 3,926
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 18
    • Merge requests 18
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #14756
Closed
Open
Created Feb 13, 2014 by Kitware Robot@kwrobotOwner

RFE: Report changes to cached values

This issue was created automatically from an original Mantis Issue. Further discussion may take place here.


Original description:

Add a variable to CMake such that it will report when a cached variable's value is different from the default being set. For example:

set(var dflt CACHE STRING "description")

could output:

path/to/CMakeLists.txt:42: var 'dflt' -> 'cachedvalue'

and could also, at the end of configure, print out a command line (or initial cache file) to be used to duplicate the build on another machine. I was thinking of CMAKE_REPORT_DELTA as the control variable.

Came up from a gn thread.

Comment from @brad.king:

Note that in Modules/CMakeGenericSystem.cmake we do:

if(NOT DEFINED CMAKE_INSTALL_PREFIX)
  set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1)
endif()
# ...
  set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "...")
# ...

so that applications can know when they can force a different default for CMAKE_INSTALL_PREFIX without overriding a user setting.

This could be generalized for use with all cache entries. It would be helpful for projects that want to override the default CMAKE_C_FLAGS_DEBUG, for example, without needing to use CMAKE_USER_MAKE_RULES_OVERRIDE and a separate file.

See also discussion in #14546 (closed).

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