Warning: This file is generated.
-
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,
srcas inadd_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!
-
C Christian Ehrlicher moved this topic from General and Desktop on
-
For latecomers, you could keep track of this issue here: https://bugreports.qt.io/browse/QTCREATORBUG-32283
-
Hi,
It does look like something is off.
Can you provide a minimal projects that triggers this behavior in Qt Creator ? -
./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 triggersThanks a lot!
-
Qt Creator 15 has changes regarding the project view. The CMake targets have their defining
CMakeLists.txtas a node.The idea would be to have a quick access to the
CMakeLists.txtthat defined the target. And only the topCMakeLists.txtis being displayed.All the rest
CMakeLists.txtare 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.txtthat would control how Qt Creator renders the project's view. -
@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.
-
For latecomers, you could keep track of this issue here: https://bugreports.qt.io/browse/QTCREATORBUG-32283
-
J JackMyson has marked this topic as solved on