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


I have a CMakeList script that runs with cmake <= 3.22.5. However, with >= 3.23.0 it throws an error:

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

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. :wink:

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.

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"

    - 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 and run cmake form the src folder.

Any thoughts ?

Thank you for the help.

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?