- 
    Bug 
- 
    Resolution: Done
- 
    P2: Important 
- 
    6.1.0
- 
    None
- 
        
- 
        e1c1558218168529ea3fd1ab2e8b775c152ef7ee (qt/tqtc-qtbase/6.2)
Re-run of cmake when configuring a Qt module for build fails when building for iOS.
Steps to reproduce on mac / bash: 
0) Set up Qt6 iOS development environment
1) git clone git://code.qt.io/qt/qtscxml.git 
2) mkdir build && cd build
3) qt-configure-module ../qtscxml   // This should pass fine
4) qt-configure-module ../qtscxml
=> The qt_add_internal* cmake calls will result in lines similar to the one below:
CMake Error at /Users/juha.vuolle/qts/6/ios_dev_source/qtbase/cmake/QtTargetHelpers.cmake:156 (add_library):
  add_library cannot create ALIAS target "Qt6::Scxml" because another target
  with the same name already exists.
Call Stack (most recent call first):
  /Users/juha.vuolle/qts/6/ios_dev_source/qtbase/cmake/QtModuleHelpers.cmake:102 (qt_internal_add_target_aliases)
  src/scxml/CMakeLists.txt:6 (qt_internal_add_module)
Some additional details:
- The issue reproduces similarly if bypassing the qt-configure-module and invoking cmake directly.
- The issue can be worked around by deleting all previous build artifacts from the qt installation directory (eg. qtbase/... if using developer build).
- The issue reproduces on two repos I tried with: qtscxml and qtsensors.
- The issue does not happen when building for android / linux / windows / mac.
| For Gerrit Dashboard: QTBUG-92578 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V | 
| 346401,2 | CMake: Fix reconfiguration when using a static top-level build | 6.1 | qt/qtbase | Status: MERGED | +2 | 0 | 
| 346502,6 | CMake: Fix reconfiguration when using a static top-level build | dev | qt/qtbase | Status: MERGED | +2 | 0 |