Skip to content

Commit fa31210

Browse files
committed
COMP: Clarify Qt Designer plugin handling for Qt5 and newer Qt
Qt5’s `Qt5Designer_DEFINITIONS` and related variables may contain generator expressions that are not compatible with direct `add_definitions()` usage. This change documents why we continue using `add_definitions()` and `include_directories()` for Qt5, and relies on target usage requirements for newer Qt versions instead of failing with a fatal error.
1 parent e6e51a3 commit fa31210

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

CMake/ctkMacroBuildQtPlugin.cmake

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,16 @@ endmacro()
174174
macro(ctkMacroBuildQtDesignerPlugin)
175175
find_package(Qt${CTK_QT_VERSION} COMPONENTS Designer REQUIRED)
176176
if(CTK_QT_VERSION VERSION_EQUAL "5")
177+
# Variables like Qt*_DEFINITIONS may include generator expressions (genex) in newer Qt versions,
178+
# which cannot be directly passed to "add_definitions()". For example, the list may include elements
179+
# like "$<$<BOOL:$<TARGET_PROPERTY:QT_PLUGIN_CLASS_NAME>>:QDESIGNER_EXPORT_WIDGETS>". Stripping these using
180+
# "string(GENEX_STRIP ...)" would result in an incomplete set of definitions.
181+
# Therefore, we maintain the use of add_definitions()/include_directories() for Qt5 and encourage
182+
# developers to rely on target usage requirements for newer versions.
177183
add_definitions(${Qt5Designer_DEFINITIONS})
178184
include_directories(${Qt5Designer_INCLUDE_DIRS})
179185
else()
180-
message(FATAL_ERROR "Support for Qt${CTK_QT_VERSION} is not implemented")
186+
# For newer Qt versions, use target usage requirements to handle definitions and include directories.
181187
endif()
182188
ctkMacroBuildQtPlugin(
183189
PLUGIN_DIR designer

0 commit comments

Comments
 (0)