title: Clion won't index auto-generated ui header files
body: <p>I was having a look at the <a href="https://github.com/keepassxreboot/keepassxc" rel="nofollow noreferrer">KeepassXC's source code</a>, with Clion as my IDE of choice. After a bit of digging and navigating through the source code, I noticed that one of the source file has the following <code>#include</code> directive:</p>
  
  <pre><code>#include "ui_MainWindow.h"
  </code></pre>
  
  <p>with a red underline. Hovering over it with my mouse, it says "'ui_MainWindow.h' not found".</p>
  
  <p>The project's <code>CMakeLists.txt</code> file provides three build types:</p>
  
  <ul>
  <li>Debug</li>
  <li>Release</li>
  <li>Release With Debug Info</li>
  </ul>
  
  <p>and, once all three build types are successfully built, the file CLion should look for is in the following location:</p>
  
  <pre><code>cmake-build-(debug|release|relwithdebuginfo)
  └── src
      └── keepassx_core_autogen
          └── include
              ├── moc_KMessageWidget.cpp
              ├── ui_AboutDialog.h
              ├── ui_CategoryListWidget.h
              ├── ui_ChangeMasterKeyWidget.h
              ├── ui_CloneDialog.h
              ├── ui_CsvImportWidget.h
              ├── ui_DatabaseOpenWidget.h
              ├── ui_DatabaseSettingsWidgetEncryption.h
              ├── ui_DatabaseSettingsWidgetGeneral.h
              ├── ui_DatabaseSettingsWidget.h
              ├── ui_DetailsWidget.h
              ├── ui_EditEntryWidgetAdvanced.h
              ├── ui_EditEntryWidgetAutoType.h
              ├── ui_EditEntryWidgetHistory.h
              ├── ui_EditEntryWidgetMain.h
              ├── ui_EditEntryWidgetSSHAgent.h
              ├── ui_EditGroupWidgetMain.h
              ├── ui_EditWidget.h
              ├── ui_EditWidgetIcons.h
              ├── ui_EditWidgetProperties.h
              ├── ui_EntryAttachmentsWidget.h
              ├── ui_MainWindow.h
              ├── ui_PasswordGeneratorWidget.h
              ├── ui_SearchWidget.h
              ├── ui_SettingsWidgetGeneral.h
              ├── ui_SettingsWidgetSecurity.h
              ├── ui_SetupTotpDialog.h
              ├── ui_TotpDialog.h
              └── ui_WelcomeWidget.h
  </code></pre>
  
  <p>After a couple hours trying to make it work, I've noticed something weird. The red underline will go away (and the code navigation will work too) only if I build the project in Debug mode (i.e. it'll only pick the file from the <code>cmake-build-debug</code>).
  If I clean the debug build and use the release build, there's no way I can get CLion to pick the file from <code>cmake-build-release</code>. Same applies for <code>cmake-build-relwithdebinfo</code>.</p>
  
  <p>The code compiles and runs just fine, meaning that the CMake configuration is correct.</p>