diff --git a/cmake/QtPublicCMakeHelpers.cmake b/cmake/QtPublicCMakeHelpers.cmake index 0888b2a8d49..ac669bfa6c6 100644 --- a/cmake/QtPublicCMakeHelpers.cmake +++ b/cmake/QtPublicCMakeHelpers.cmake @@ -880,12 +880,12 @@ function(_qt_internal_configure_file mode) # the generator expressions evaluation inside the resulting CONTENT. if(mode STREQUAL "GENERATE") if(arg_INPUT) - # This is not a limitation of any kind, simply is not required at - # implementation time. Feel free to extend. - message(FATAL_ERROR "GENERATE mode doesn't support INPUT argument.") + configure_file("${arg_INPUT}" "${arg_OUTPUT}.tmp" @ONLY) + file(GENERATE OUTPUT "${arg_OUTPUT}" INPUT "${arg_OUTPUT}.tmp") + else() + string(CONFIGURE "${arg_CONTENT}" arg_CONTENT @ONLY) + file(GENERATE OUTPUT "${arg_OUTPUT}" CONTENT "${arg_CONTENT}") endif() - string(CONFIGURE "${arg_CONTENT}" arg_CONTENT @ONLY) - file(GENERATE OUTPUT "${arg_OUTPUT}" CONTENT "${arg_CONTENT}") return() endif()