diff options
author | Alexey Edelev <alexey.edelev@qt.io> | 2021-05-05 15:58:58 +0200 |
---|---|---|
committer | Alexey Edelev <alexey.edelev@qt.io> | 2021-05-10 13:17:51 +0200 |
commit | 1acbc29ef950369a67256221d10867a32282412c (patch) | |
tree | 013dcf8d8be27cda0529c5d51daf2beedfa7b701 /src | |
parent | b5202bb5cf1bc5060ba7aa2c4679d848001fff02 (diff) | |
download | qtactiveqt-1acbc29ef950369a67256221d10867a32282412c.tar.gz |
Add support of the type library UUID
dumpcpp supports generating of the sources using the type library UUID.
Add syntax that provides this functionality to the qt6_target_typelibs
users.
Modify the qutlook library to use the new syntax.
Amends da3a24c06541b63011a3af91fbae9f9d2ec28912.
Pick-to: 6.1
Fixes: QTBUG-93446
Change-Id: Ic0b657bd39f57d32c3d404bee395f4f375a6d7f8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/activeqt/container/Qt6AxContainerMacros.cmake | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/src/activeqt/container/Qt6AxContainerMacros.cmake b/src/activeqt/container/Qt6AxContainerMacros.cmake index 4e90943..82a0745 100644 --- a/src/activeqt/container/Qt6AxContainerMacros.cmake +++ b/src/activeqt/container/Qt6AxContainerMacros.cmake @@ -8,6 +8,10 @@ # CMake find_file function rules. See https://cmake.org/cmake/help/latest/command/find_file.html # for details. # Note: The library name must include a file suffix, e.g "ieframe.dll". +# LIBRARIES also may contain the library UUID in the following format: +# <generated_files_basename>:<{00000000-0000-0000-0000-000000000000}> +# The 'generated_files_basename' may contain ASCII letters, numbers and underscores and will be +# used as the base name for the generated files. # # OUTPUT_DIRECTORY: Custom location of the generated source files. # ${CMAKE_CURRENT_BINARY_DIR} is the default location if not specified. (OPTIONAL) @@ -34,22 +38,34 @@ function(qt6_target_typelibs target) endif() set(out_sources "") + set(hex "[a-fA-F0-9]") + set(ident_ "[a-fA-F0-9_]") foreach(lib IN LISTS arg_LIBRARIES) unset(libpath CACHE) - # If lib exists on the filesystem, we assume the user provided the path. - get_filename_component(lib_abspath "${lib}" ABSOLUTE) - if(EXISTS "${lib_abspath}") - set(libpath "${lib_abspath}") + if(lib MATCHES "^(${ident_}+):(\\{${hex}{8}-${hex}{4}-${hex}{4}-${hex}{4}-${hex}{12}\\})$") + set(libpath "${CMAKE_MATCH_2}") + set(out_basename "${CMAKE_MATCH_1}") + string(MAKE_C_IDENTIFIER "${out_basename}" out_basename_valid) + if(NOT "${out_basename_valid}" STREQUAL "${out_basename}") + message("The specified generated files basename ${out_basename} is not valid\ +C indentifier") + endif() else() - find_file(libpath NAMES "${lib}") - if(NOT libpath) - message(FATAL_ERROR "qt6_target_typelibs: Unable to find type lib with name ${lib}") + # If lib exists on the filesystem, we assume the user provided the path. + get_filename_component(lib_abspath "${lib}" ABSOLUTE) + if(EXISTS "${lib_abspath}") + set(libpath "${lib_abspath}") + else() + find_file(libpath NAMES "${lib}") + if(NOT libpath) + message(FATAL_ERROR "qt6_target_typelibs: Unable to find type lib with name ${lib}") + endif() endif() + + get_filename_component(out_basename "${libpath}" NAME_WE) endif() - get_filename_component(out_basename "${libpath}" NAME_WE) set(out_filebasepath "${output_directory}/${out_basename}") - set(out_header "${out_filebasepath}.h") set_source_files_properties("${out_header}" PROPERTIES HEADER_FILE_ONLY TRUE) set(out_source "${out_filebasepath}.cpp") |