From 55af91f822027f079e435eb13d9bf379496fe1bb Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 6 May 2022 15:15:22 +0200 Subject: CMake: Put Qt-internal targets into a dedicated FOLDER When loading a Qt CMake project in an IDE like Visual Studio, many Qt-internal targets are visible, right next to the user's targets. This is inconvenient and confusing. Use CMake's FOLDER concept, and put Qt-internal targets into a dedicated FOLDER. For that we introduce the new global property QT_TARGETS_FOLDER that, analoguous to AUTOGEN_TARGETS_FOLDER, is the folder name for Qt-internal targets. By default, it's not set, nor is folder support enabled. Change qt_standard_project_setup() to - enable folder support - initialize QT_TARGETS_FOLDER if unset - initialize AUTOGEN_TARGETS_FOLDER to the same value if unset Set the FOLDER property of qtbase's internal targets for user projects to the value of QT_TARGETS_FOLDER. Task-number: QTBUG-99808 Change-Id: I880ac7731f88faa83a384dcdec98b1b88ac6cc2e Reviewed-by: Alexandru Croitor --- cmake/QtProperties.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cmake') diff --git a/cmake/QtProperties.cmake b/cmake/QtProperties.cmake index e4ba4d273b..12e0fe6b8b 100644 --- a/cmake/QtProperties.cmake +++ b/cmake/QtProperties.cmake @@ -108,3 +108,13 @@ define_property(TARGET FULL_DOCS "Specifies the qml module's version." ) + +define_property(GLOBAL + PROPERTY + QT_TARGETS_FOLDER + BRIEF_DOCS + "Name of the FOLDER for targets internally created by AUTOGEN and Qt's CMake API." + FULL_DOCS + "This property is used to initialize AUTOGEN_TARGETS_FOLDER and the FOLDER property of + internal targets created by Qt's CMake commands." +) -- cgit v1.2.3