Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-93727

CMake Error with -developer-build due to target name conflict

    XMLWordPrintable

Details

    • Linux/X11
    • 3c06129432452e212a338f688d3ff1c7a563d270 (qt/qtscxml/dev)

    Description

      The problem happens when both qtscxml and qtremoteobjects are cloned.
      To reproduce the problem initialize the repository with:

      ./init-repository --module-subset=qtbase,qtdeclarative,qtscxml,qtremoteobjects
      

      Then configure Qt in an empty build directory:

      ../qt6-dev-src/configure -developer-build
      

      The configure fails with:

      CMake Error at qtbase/cmake/QtExecutableHelpers.cmake:28 (add_executable):                                                                                                                                                                                                       
        add_executable cannot create target "tst_parser" because another target                                                                                                                                                                                                        
        with the same name already exists.  The existing target is an executable                                                                                                                                                                                                       
        created in source directory                                                                                                                                                                                                                                                    
        "/mnt/hdd/work/Qt/tmp/qt6-dev-src/qtremoteobjects/tests/auto/repparser".                                                                                                                                                                                                       
        See documentation for policy CMP0002 for more details.                                                                                                                                                                                                                         
      Call Stack (most recent call first):                                                                                                                                                                                                                                             
        qtbase/cmake/QtTestHelpers.cmake:214 (qt_internal_add_executable)                                                                                                                                                                                                              
        qtscxml/tests/auto/parser/CMakeLists.txt:6 (qt_internal_add_test)                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                       
                                                                                                                                                                                                                                                                                       
      CMake Error at qtbase/cmake/QtTestHelpers.cmake:331 (add_custom_target):                                                                                                                                                                                                         
        add_custom_target cannot create target "tst_parser_check" because another                                                                                                                                                                                                      
        target with the same name already exists.  The existing target is a custom                                                                                                                                                                                                     
        target created in source directory                                                                                                                                                                                                                                             
        "/mnt/hdd/work/Qt/tmp/qt6-dev-src/qtremoteobjects/tests/auto/repparser".                                                                                                                                                                                                       
        See documentation for policy CMP0002 for more details.                                                                                                                                                                                                                         
      Call Stack (most recent call first):                                                                                                                                                                                                                                             
        qtscxml/tests/auto/parser/CMakeLists.txt:6 (qt_internal_add_test) 
      

      I have also attached the full log of the configure: developer-build.log

      It doesn't fail when configuring without -developer-build or https://codereview.qt-project.org/c/qt/qtbase/+/348485 is reverted from qtbase.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtbuildsystem Qt Build System Team
            pvarga Peter Varga
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes