# troubles when complinig

**URL:** https://discourse.cmake.org/t/troubles-when-complinig/9467
**Category:** Development
**Created:** [November 20, 2023, 4:43am UTC](https://discourse.cmake.org/t/troubles-when-complinig/9467 "2023-11-20T04:43:44Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![bytecounter](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/4491bb/32.png) [@bytecounter](https://discourse.cmake.org/u/bytecounter)
#### Post date: [November 20, 2023, 4:43am UTC](https://discourse.cmake.org/t/troubles-when-complinig/9467/1 "2023-11-20T04:43:44Z")

</div>

```auto
+ mkdir -p qtbase
+ cd qtbase
+ exec /home/stuv/Qt/6.6.0/Src/qtbase/configure -top-level
'/usr/local/bin/cmake' '-DQT_INTERNAL_CALLED_FROM_CONFIGURE:BOOL=TRUE' '-G' 'Unix Makefiles' '/home/stuv/Qt/6.6.0/Src'
CMake Error: Error: generator : Unix Makefiles
Does not match the generator used previously: Ninja
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:1038 (message):
  CMake exited with code 1.

```

i tried to delete the file and the folder and i get:

```auto
CMake Error: Error: generator : Ninja
Does not match the generator used previously: Unix Makefiles
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
CMake Error at qtbase/cmake/QtSeparateDebugInfo.cmake:53 (try_compile):
  Failed to configure test project build system.
Call Stack (most recent call first):
  qtbase/cmake/QtSeparateDebugInfo.cmake:114 (qt_internal_try_compile_binary_for_strip)
  qtbase/cmake/QtBuildInternals/QtBuildInternalsConfig.cmake:447 (qt_internal_generate_binary_strip_wrapper)
  qtbase/CMakeLists.txt:127 (qt_build_repo_begin)

-- Configuring incomplete, errors occurred!
CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:1038 (message):
  CMake exited with code 1.

```

---

<div class="post-metadata">

### Author: ![bytecounter](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/4491bb/32.png) [@bytecounter](https://discourse.cmake.org/u/bytecounter)
#### Post date: [November 20, 2023, 4:46am UTC](https://discourse.cmake.org/t/troubles-when-complinig/9467/2 "2023-11-20T04:46:10Z")

</div>

i tried a complete reintall of qt but same error

---

<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: [November 20, 2023, 12:37pm UTC](https://discourse.cmake.org/t/troubles-when-complinig/9467/3 "2023-11-20T12:37:03Z")

</div>

It looks like Qt is not considering an already-existing directory may spoil things. Can you please provide the full sequence of commands you used to get to this state? I suspect Qt should pass `--fresh` if CMake is 3.24 or newer and make noise otherwise if `CMakeFiles/` or `CMakeCache.txt` already exist in the build directory of interest.

Cc: @craig.scott @alcroito

---

<div class="post-metadata">

### Author: ![alcroito](https://discourse.cmake.org/user_avatar/discourse.cmake.org/alcroito/32/186_2.png) [@alcroito](https://discourse.cmake.org/u/alcroito)
#### Post date: [November 20, 2023, 1:10pm UTC](https://discourse.cmake.org/t/troubles-when-complinig/9467/4 "2023-11-20T13:10:55Z")

</div>

Qt’s configure allows reconfiguring in an existing build directory, so removing CMakeCache.txt and friends or complaining about it is not possible, because the intent might be to do a reconfiguration with slightly different options, rather than a clean configuration from scratch.

Qt’s configure accepts --fresh, so if the intent is to do a clean build, that can be explicitly passed.

I’m not sure how the OP ended up in their situation.  
It also looks weird that they call cmake on the top-level source dir “Src” within a qtbase subdirectory.  
Either they should call configure from “Src/qtbase/configure”, or call “Src/configure” but not within a qtbase build subdirectory.

---

<div class="post-metadata">

### Author: ![bytecounter](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/4491bb/32.png) [@bytecounter](https://discourse.cmake.org/u/bytecounter)
#### Post date: [November 20, 2023, 1:46pm UTC](https://discourse.cmake.org/t/troubles-when-complinig/9467/5 "2023-11-20T13:46:51Z")

</div>

[https://paste.debian.net/1298679/](https://paste.debian.net/1298679/)

---

<div class="post-metadata">

### Author: ![bytecounter](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/4491bb/32.png) [@bytecounter](https://discourse.cmake.org/u/bytecounter)
#### Post date: [November 20, 2023, 1:49pm UTC](https://discourse.cmake.org/t/troubles-when-complinig/9467/6 "2023-11-20T13:49:24Z")

</div>

cmake --fresh . let the configuration finish!

---

<div class="post-metadata">

### Author: ![bytecounter](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/4491bb/32.png) [@bytecounter](https://discourse.cmake.org/u/bytecounter)
#### Post date: [November 20, 2023, 1:57pm UTC](https://discourse.cmake.org/t/troubles-when-complinig/9467/8 "2023-11-20T13:57:25Z")

</div>

but then cmake --build . gives me: [stuv@localhost:~/Qt/6.6.0/Src$ cmake --build .[1%] Generating pc file for ta - Pastebin.com](https://pastebin.com/uii9Jg7e)

---

<div class="post-metadata">

### Author: ![alcroito](https://discourse.cmake.org/user_avatar/discourse.cmake.org/alcroito/32/186_2.png) [@alcroito](https://discourse.cmake.org/u/alcroito)
#### Post date: [November 20, 2023, 2:04pm UTC](https://discourse.cmake.org/t/troubles-when-complinig/9467/9 "2023-11-20T14:04:15Z")

</div>

You’re trying to build Qt WebEngine and it fails due to a missing `cups-config` binary. You will either need to skip building WebEngine, or install all required dependencies.

Having said that, the CMake forum is not the right place to seek support for building Qt.  
A more appropriate place would be the Qt forums at [https://forum.qt.io/](https://forum.qt.io/)

---

<div class="post-metadata">

### Author: ![bytecounter](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/4491bb/32.png) [@bytecounter](https://discourse.cmake.org/u/bytecounter)
#### Post date: [November 20, 2023, 2:50pm UTC](https://discourse.cmake.org/t/troubles-when-complinig/9467/10 "2023-11-20T14:50:10Z")

</div>

ty
