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,816
    • Issues 3,816
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 6
    • Merge requests 6
  • 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
  • #23119
Closed
Open
Created Jan 18, 2022 by Brad King@brad.kingOwner

cmake: Add option to reset build tree and start from scratch

Sometimes users want to re-run CMake from scratch as if the build tree were never before processed. Currently this can be done either by removing the entire build directory, or by removing CMakeCache.txt and CMakeFiles/ from the top-level directory of the build tree.

This use case could be simplified if CMake had an option to say "pretend this is the first invocation on this build tree". Internally CMake would then wipe out CMakeCache.txt and CMakeFiles/ if they exist, and then start configuring from scratch.

For example:

$ cmake --fresh -S src -B build

would treat the build directory as a fresh build tree. If it has a CMakeCache.txt and/or CMakeFiles/, they will be removed first. Either way, the configure step then runs from scratch in the build tree.

Edited Feb 11, 2022 by Brad King
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking