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

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

      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?

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes