Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-26700

CMake: Do not indent closing parenthesis if on it's own line

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • P4: Low
    • None
    • None
    • Editors
    • None
    • 11435ebedbff4ded01a9196d9ee9e38a98d5403a (qt-creator/qt-creator/master)

    Description

      Most of our CMakeLists.txt in Qt examples are formatted like

      qt_add_executable(chip
          chip.cpp chip.h
          main.cpp
          mainwindow.cpp mainwindow.h
          view.cpp view.h
      )
      set_target_properties(chip PROPERTIES
          WIN32_EXECUTABLE TRUE
          MACOSX_BUNDLE TRUE
      )
      target_link_libraries(chip PUBLIC
          Qt::Core
          Qt::Gui
          Qt::Widgets
      )
      

      However, using the internal indenter in Qt Creator (e.g. by Edit > Advanced > Auto-Indent Section) will format this to

      qt_add_executable(chip
          chip.cpp chip.h
          main.cpp
          mainwindow.cpp mainwindow.h
          view.cpp view.h
          )
      set_target_properties(chip PROPERTIES
          WIN32_EXECUTABLE TRUE
          MACOSX_BUNDLE TRUE
          )
      target_link_libraries(chip PUBLIC
          Qt::Core
          Qt::Gui
          Qt::Widgets
          )
      

      IMO the style of not indenting the closing parenthesis is easier to read. Can Qt Creator adapt this?

      Attachments

        Issue Links

          For Gerrit Dashboard: QTCREATORBUG-26700
          # Subject Branch Project Status CR V

          Activity

            People

              davschul David Schulz
              kkohne Kai Köhne
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes