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

QtCreator+cmake: files may appear twice in project view

XMLWordPrintable

      As described in QTCREATORBUG-17861: QtCrator 4.2 does not list header-only implementations in the project view if they are not mentioned in any CMakeLists.txt file.

      New in QtCreator 4.3 beta 1: header files are listed in the project view even if they are not mentioned in the cmake files (as long as "hide generated files" is not checked).

      A workaround for QtCreator 4.2 is to create a dummy target that collects all header files:

      file(GLOB_RECURSE ALL_HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.hpp")
      add_library(dummy_target_with_all_headers EXCLUDE_FROM_ALL ${ALL_HEADER_FILES})
      target_link_libraries(dummy_target_with_all_headers)
      set_target_properties(dummy_target_with_all_headers PROPERTIES LINKER_LANGUAGE CXX)
      

      Opening the project in QtCreator 4.3 with such a dummy target leads to doubled header files in the project view (if "hide generated files" is not checked).

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

            hunger Tobias Hunger
            mic Michael Hanfland
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes