# Can't find CMakeCache.txt, but need to delete and regenerate it.

**URL:** https://discourse.cmake.org/t/cant-find-cmakecache-txt-but-need-to-delete-and-regenerate-it/8708
**Category:** Usage
**Created:** [August 9, 2023, 10:45pm UTC](https://discourse.cmake.org/t/cant-find-cmakecache-txt-but-need-to-delete-and-regenerate-it/8708 "2023-08-09T22:45:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ythene](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/y/db5fbb/32.png) [@Ythene](https://discourse.cmake.org/u/Ythene)
#### Post date: [August 9, 2023, 10:45pm UTC](https://discourse.cmake.org/t/cant-find-cmakecache-txt-but-need-to-delete-and-regenerate-it/8708/1 "2023-08-09T22:45:47Z")

</div>

Hello! I am attempting to CMake FreeGLUT on 64-bit Windows, and I’m running into some issues.

I created a build/ directory and ran the following command:

```auto
cmake.exe -G "MinGW Makefiles" -DCMAKE_C_COMPILER=C:\\msys64\\mingw64\\bin\\gcc.exe ..
CMake Deprecation Warning at CMakeLists.txt:1 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- The C compiler identification is GNU 13.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:\msys64\mingw64\bin\gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at build/CMakeFiles/3.27.1/CMakeCCompiler.cmake:1 (set):
  Syntax error in cmake code at

    C:/Users/<User>/Downloads/freeglut-3.4.0 (1)/freeglut-3.4.0/build/CMakeFiles/3.27.1/CMakeCCompiler.cmake:1

  when parsing string

    C:\msys64\mingw64\bin\gcc.exe

  Invalid escape sequence \m
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.27/Modules/CMakeTestCCompiler.cmake:85 (include)
  CMakeLists.txt:2 (PROJECT)

-- Configuring incomplete, errors occurred!
You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_C_COMPILER= C:\\msys64\\mingw64\\bin\\gcc.exe

-- Generating done (0.0s)
CMake Generate step failed. Build files cannot be regenerated correctly.

```

Okay, that’s my bad. Windows needs `\\` for directories. But, in the build directory, and at the top level directory, I cannot find the cache file in order to delete it:

```auto
\freeglut-3.4.0\build> ls -r

    Directory: C:\Users\Colin\Downloads\freeglut-3.4.0 (1)\freeglut-3.4.0\build

Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 8/9/2023 4:40 PM CMakeFiles
-a---- 8/9/2023 4:28 PM 1488 cmake_install.cmake
-a---- 8/9/2023 4:40 PM 4240 Makefile

    Directory: C:\Users\Colin\Downloads\freeglut-3.4.0 (1)\freeglut-3.4.0\build\CMakeFiles

Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 8/9/2023 4:40 PM 715 CMakeDirectoryInformation.cmake
-a---- 8/9/2023 4:40 PM 7549 Makefile.cmake
-a---- 8/9/2023 4:40 PM 2397 Makefile2
-a---- 8/9/2023 4:40 PM 3 progress.marks
-a---- 8/9/2023 4:40 PM 187 TargetDirectories.txt

```

And the top level directory:

```auto
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 8/9/2023 4:27 PM .github
d----- 8/9/2023 4:27 PM altbuild
d----- 8/9/2023 4:27 PM android
d----- 8/9/2023 4:40 PM build
d----- 8/9/2023 4:27 PM include
d----- 8/9/2023 4:27 PM progs
d----- 8/9/2023 4:27 PM src
-a---- 10/7/2022 10:12 AM 375 .gitignore
------ 10/7/2022 10:12 AM 261 android_toolchain.cmake
-a---- 10/7/2022 10:12 AM 1249 AUTHORS
-a---- 10/7/2022 10:12 AM 9782 blackberry.toolchain.cmake
-a---- 10/7/2022 10:12 AM 168281 ChangeLog
-a---- 10/7/2022 10:12 AM 24314 CMakeLists.txt
-a---- 10/7/2022 10:12 AM 723 config.h.in
-a---- 10/7/2022 10:12 AM 1439 COPYING
-a---- 10/7/2022 10:12 AM 340 freeglut.pc.in
-a---- 10/7/2022 10:12 AM 1262 freeglut.rc.in
-a---- 10/7/2022 10:12 AM 59 FreeGLUTConfig.cmake.in
-a---- 10/7/2022 10:12 AM 232 mingw_cross_toolchain.cmake
-a---- 10/7/2022 10:12 AM 57 README.android
-a---- 10/7/2022 10:12 AM 1118 README.blackberry
-a---- 10/7/2022 10:12 AM 4452 README.cmake
-a---- 10/7/2022 10:12 AM 8080 README.cygwin_mingw
-a---- 10/7/2022 10:12 AM 1988 README.macosx
-a---- 10/7/2022 10:12 AM 3985 README.md
-a---- 10/7/2022 10:12 AM 1065 README.mingw_cross
-a---- 10/7/2022 10:12 AM 4577 README.win32

```

Can anyone assist me in finding this file so I can delete it and regenerate it? It’s nowhere in the freeGLUT directory that I can see.

Thank you in advance!

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [August 9, 2023, 11:17pm UTC](https://discourse.cmake.org/t/cant-find-cmakecache-txt-but-need-to-delete-and-regenerate-it/8708/2 "2023-08-09T23:17:58Z")

</div>

> [@Ythene](#):
>
> Okay, that’s my bad. Windows needs `\\` for directories. But, in the build directory, and at the top level directory, I cannot find the cache file in order to delete it:

CMake prefers `/` everywhere (because they work just about everywhere). `cmd` is a big exception.

> [@Ythene](#):
>
> Can anyone assist me in finding this file so I can delete it and regenerate it?

It might not exist yet (as it died in `project` before anything else ended up running. In any case, 3.27 has the `--fresh` flag to handle starting from scratch.

---

<div class="post-metadata">

### Author: ![Ythene](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/y/db5fbb/32.png) [@Ythene](https://discourse.cmake.org/u/Ythene)
#### Post date: [August 9, 2023, 11:59pm UTC](https://discourse.cmake.org/t/cant-find-cmakecache-txt-but-need-to-delete-and-regenerate-it/8708/3 "2023-08-09T23:59:18Z")

</div>

Thank you! Running with --fresh and using backslashes in tandem worked!

Issue solved!
