Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Warning: This file is generated.
QtWS25 Last Chance

Warning: This file is generated.

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
qt-creatorgenerated-filewarning-tfig
6 Posts 3 Posters 1.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JackMyson
    wrote on 29 Dec 2024, 07:16 last edited by
    #1

    When I upgraded my Qt Creator to the newest, i.e. version 15.0.0, the CMake sub-directory indices are all disappeared. Also, when I click into the, let say, src as in add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/src}), and typed in/ deleted something in the file, it popped up something like "Warning: This file is generated. Do not show again". Although it causes no harm to my project, it's very annoying.

    Anyone knows if it is a normal phenomenon or not, for an upgraded Qt Creator?

    (That is, I've never encountered any problems in Qt Creator v. 13 and 14.)

    Thank in advance!

    1 Reply Last reply
    0
    • C Christian Ehrlicher moved this topic from General and Desktop on 29 Dec 2024, 07:55
    • J Offline
      J Offline
      JackMyson
      wrote on 3 Jan 2025, 12:25 last edited by
      #6

      For latecomers, you could keep track of this issue here: https://bugreports.qt.io/browse/QTCREATORBUG-32283

      1 Reply Last reply
      1
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 29 Dec 2024, 08:17 last edited by
        #2

        Hi,

        It does look like something is off.
        Can you provide a minimal projects that triggers this behavior in Qt Creator ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • J Offline
          J Offline
          JackMyson
          wrote on 31 Dec 2024, 06:39 last edited by
          #3

          ./CMakeLists.txt

          cmake_minimum_required(VERSION 3.16)
          
          project(Testing VERSION 0.7.0 LANGUAGES CXX)
          
          set(CMAKE_AUTOUIC ON)
          set(CMAKE_AUTOMOC ON)
          set(CMAKE_AUTORCC ON)
          set(CMAKE_CXX_STANDARD 20)
          set(CMAKE_CXX_STANDARD_REQUIRED 20)
          
          find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
          find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)
          
          set(SOURCES "")
          
          include_directories(${CMAKE_CURRENT_LIST_DIR}/src)
          
          add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/src)  # <- This file!!
          
          if (${QT_VERSION_MAJOR} GREATER_EQUAL 6)
              qt_add_executable(Testing MANUAL_FINALIZATION ${SOURCES})
          else()
              if (ANDROID)
                  add_library(Testing SHARED ${SOURCES})
              else()
                  add_executable(Testing ${SOURCES})
              endif()
          endif()
          
          target_link_libraries(Testing PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
          
          if (${QT_VERSION} VERSION_LESS 6.1.0)
              set(BUNDLE_ID_OPTION MACOSX_BUNDLE_GUI_IDENTIFIER com.example.Testing)
          endif (${QT_VERSION} VERSION_LESS 6.1.0)
          
          set_target_properties(Testing
              PROPERTIES
              ${BUNDLE_ID_OPTION}
              MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
              MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
              MACOSX_BUNDLE TRUE
              WIN32_EXECUTABLE TRUE
          )
          
          include(GNUInstallDirs)
          install(TARGETS Testing
              BUNDLE DESTINATION .
              LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
              RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
          )
          
          if(QT_VERSION_MAJOR EQUAL 6)
              qt_finalize_executable(Testing)
          endif()
          

          ./src/CMakeLists.txt

          set(SOURCES
              ${SOURCES}
              ${CMAKE_CURRENT_LIST_DIR}/main.cpp
              PARENT_SCOPE
          )
          # When I edit this file, it triggers
          

          Thanks a lot!

          1 Reply Last reply
          0
          • C Online
            C Online
            cristian-adam
            wrote on 31 Dec 2024, 12:37 last edited by
            #4

            Qt Creator 15 has changes regarding the project view. The CMake targets have their defining CMakeLists.txt as a node.

            The idea would be to have a quick access to the CMakeLists.txt that defined the target. And only the top CMakeLists.txt is being displayed.

            All the rest CMakeLists.txt are marked as generated, that's why you get the annoying warning.

            Please do open a bug report at https://bugreports.qt.io/secure/CreateIssue.jspa?pid=10512

            I could think of an option or a variable set in the top CMakeListst.txt that would control how Qt Creator renders the project's view.

            1 Reply Last reply
            1
            • J Offline
              J Offline
              JackMyson
              wrote on 3 Jan 2025, 12:16 last edited by
              #5

              @cristian-adam Yes, you're absolutely correct. The best way to deal with this annoying thingy is just putting some check buttons inside Edit->Preferences->Environment or CMake->display/hide quick views. That would be great.

              Anyway, am going to suggest doing so on the Bug Reporter. Thanks for the response.

              1 Reply Last reply
              0
              • J Offline
                J Offline
                JackMyson
                wrote on 3 Jan 2025, 12:25 last edited by
                #6

                For latecomers, you could keep track of this issue here: https://bugreports.qt.io/browse/QTCREATORBUG-32283

                1 Reply Last reply
                1
                • J JackMyson has marked this topic as solved on 11 Jan 2025, 04:11

                6/6

                3 Jan 2025, 12:25

                • Login

                • Login or register to search.
                6 out of 6
                • First post
                  6/6
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved