# CUSTOMBUILD : error : could not load cache on cmake \> 3.23.0

**URL:** https://discourse.cmake.org/t/custombuild-error-could-not-load-cache-on-cmake-3-23-0/6026
**Category:** Usage
**Created:** [July 7, 2022, 6:04pm UTC](https://discourse.cmake.org/t/custombuild-error-could-not-load-cache-on-cmake-3-23-0/6026 "2022-07-07T18:04:03Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![kmilo9999](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kmilo9999/32/1246_2.png) [@kmilo9999](https://discourse.cmake.org/u/kmilo9999)
#### Post date: [July 7, 2022, 6:04pm UTC](https://discourse.cmake.org/t/custombuild-error-could-not-load-cache-on-cmake-3-23-0/6026/1 "2022-07-07T18:04:03Z")

</div>

Hello,

[I have a CMakeList](https://github.com/brown-ccv/Choreograph/tree/stable/src) script that runs with cmake \<= 3.22.5. However, with \>= 3.23.0 it throws an error:

```auto
Performing install step for 'Choreograph'
CUSTOMBUILD : error : could not load cache[F:\MYPROJECT\superbuild\Choreograph\Choreograph.vcxproj]

```

I went through the release notes, but I couldnt point to the specific change that produces this error.  
Any thoughts?

I appreciate the help

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [July 7, 2022, 10:43pm UTC](https://discourse.cmake.org/t/custombuild-error-could-not-load-cache-on-cmake-3-23-0/6026/2 "2022-07-07T22:43:38Z")

</div>

There’s not really much to go on in your post. You’ll need to provide more detail about what you’re doing, ideally with some sort of minimal reproducer project. Edit: sorry, just saw you provided a link. Pre-coffee moment on my part. 😉

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [July 7, 2022, 10:50pm UTC](https://discourse.cmake.org/t/custombuild-error-could-not-load-cache-on-cmake-3-23-0/6026/3 "2022-07-07T22:50:27Z")

</div>

The `ChoreographConfig.cmake` file doesn’t seem to be correct, since it references a file that doesn’t exist. I’ll assume that is not a file you’re using in any way.

The `CMakeLists.txt` file puts the `project()` and `cmake_minimum_required()` commands in the wrong order. The latter should come first. I couldn’t immediately see anything else obviously wrong, but try fixing that issue first and see if things change.

Maybe also show the commands you’re running too.

---

<div class="post-metadata">

### Author: ![kmilo9999](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kmilo9999/32/1246_2.png) [@kmilo9999](https://discourse.cmake.org/u/kmilo9999)
#### Post date: [July 8, 2022, 2:40pm UTC](https://discourse.cmake.org/t/custombuild-error-could-not-load-cache-on-cmake-3-23-0/6026/4 "2022-07-08T14:40:13Z")

</div>

It seems the problem comes from the command I am running:

`C:\Choreograph\src> cmake --build .\build`  
`Error: could not load cache`

However, when I run:

`C:\Choreograph\src> cmake -S . -B .\build`  
It does work.

I am trying to point out from the release notes what change from 3.22.5 to 3.23.0 that raises this error.

My build tree looks like this"

```auto
Choreograph/
    - samples
    - src
         - build
         - choreograph
         - CMakeLists.txt
         - ChoreographConfig.cmake
    - tests

```

Currently, I have a superbuild script on another project that downloads this library as an external dependency and links to it. The problematic command is the one run by the superbuild script, but I managed to generate the same error by [cloning the base library](https://github.com/brown-ccv/Choreograph/tree/stable/src) and run cmake form the `src` folder.

Any thoughts ?

Thank you for the help.

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [July 9, 2022, 2:13am UTC](https://discourse.cmake.org/t/custombuild-error-could-not-load-cache-on-cmake-3-23-0/6026/5 "2022-07-09T02:13:18Z")

</div>

Ah, that makes more sense. When you run `cmake --build ...`, that assumes you’ve already run CMake to configure and generate the build tool’s project files. That’s what `cmake -S . -B .\build` is doing, so it makes sense that `cmake --build ...` fails if you haven’t previously run something like `cmake -S . -B build`. The two commands you’ve shown are very different in their purpose.

I don’t know how things worked with any previous CMake version. Maybe you still haven’t shown the full sequence of commands you are running?
