vcpkg/ports/qt5-base/patches/prl_parser.patch

261 lines
14 KiB
Diff
Raw Normal View History

[Qt[latest]] Update to 5.14.2 (#10644) * make qt5 all features and add the missing qt modules * fix control * qt5 webengine enviromnent setup * copy qtminimal plugin to tools * add opengles3 option for testing * [qt5-imageformats] freeglut is not a dependency on osx * [qt5-base] fontconfig can require iconv on linux and osx * include the jasper fix to get CI coverage? * trying to get ci coverage for qt on osx * Revert "trying to get ci coverage for qt on osx" This reverts commit 8b9b188839ec90c25b54b49d17cf03c50987a49b. * apply the correct ci hack * fix wrapper to include macosx debug suffix * update baseline * first try to fix the Qt5 cmake configs at the root. * fix missing backslash * fix plugin patch * fix qt config patch * remove 90% of fixcmake.py * update baseline * experimental removal of fixcmake.py and dll copying into tools/qt5/bin * fix experimental dll copying. * fix static windows builds * fix static builds * fix plugin copy * add quotes around configuration to make it work * remove dll debug messages * note about the cmake fix * revert fontconfig changes on linux. Make qt.conf relative and not absolute * make qt.conf relative * trying to fix ogre osx ci regression * fix silly path error * Revert "trying to fix ogre osx ci regression" This reverts commit 708d8250d6eae81bb9a030ff7edef22d2ea1e67c. * add ogre:x64-osx=fail to CI baseline * retry on osx * fix configure error. since in qt5-base everything is in the package directory and not in the installed * revert change to ci.baseline * update ci baseline * update Qt Control fields * update qt hashes to 5.12.7 * update baseline update missing hashes update empty include/packages add info for placeholder ports not yet correctly working (e.g. qt5-wayland) * fix linux qt targets not having debug properties. * remove most of the wrapper * actual forgot to commit the prl parser * fix the config a bit differently. have to check linux configs again * add xlib patch. * make qt-base fail to get logs on linux * Need logs from qt5-base * update versions I missed * ws change * lets see if this is enough to make qt5-x11extras happy * add upstream patch. * add newline to patch * ws change to trigger rebuild and maybe get logs on osx failure * need generated cmakescripts to check linkage. * rename cmake files to end on .log so that i can inspect them after CI failure * fix patch * make qt run * androidextras only supports android * qt5-doc will only be build on linux * ws ci trigger due to download failure * WS to retrigger CI due to download failure * add code for debug tools * lets see if we can do it with only the release tools * update baseline * fix create link error on linx * update baseline * revert changes which tried to use release tools only * fix dependencies * add debug qt.conf * add another copyright install * qtdoc does not have any include files * fix wrong copy pasta * update latest port hashes. * make the patches versions dependent * cleanup qt5 control a bit * update qt5-base control for ci run to use latest * fix patches for latest * forgot to commit the portfile changes * fix imageformat dependencies for latest qt * update last hash * fix translations dependencies * get cmake scripts from CI * new patch for creating correct configs * patch precompiled headers away from qt5-webengine * fix patch for 5.12.7. (Patch was for 5.14.1) * trigger CI rebuild * add simple gl path to fix the chormium build error * comment out debug message from prl parser * bump control * update webengine control * update CI to skip webengine. * update baseline * ws change to osg-qt * remove kd-soap from faillist * reset ci baseline to upstream/master * update baseline * fix osg-qt? * skip ms-angle on osx and linux since the normal angle port should be used! * update ci baseline * try adding fontconfig manually * update ci baseline to remove osg-qt for the time being * remove manual library. * remove wrapper and get plugin info also from linux and osx * allow build of complete qt * fix missing parameter in populate plugin. * need more info from CI * fix foreach CI loop * comment out CI code colllection to make a full qt5 ci run * fix qt5-imageformats regression on linux * update baseline * - add patch to find the debug library - manually fix EGL path in Qt5GuiConfigExtras.cmake * bump control * update hashes to 5.14.2 * comment out messages for debugging * bump version in control * fix create cmake patch * add qtmain path corrections for single configuration build. * fix escaping of . in regex * remove one to many \\ * remove latest as a default feature * reenable messages to debug osg-qt issue on osx. * small cmake options details. might need to patch cmakelists.txt if this is not working * remove unnecessary comment * make prl parser silent again. * remove canvas3d from the default features since it has been deprecated and will be removed in the future * remove ws change * remove newline and ws * trigger ci test * revert 199a3ef92f83775a61bd0f9beee0c48698bff1b6 * add messages to qt5-webengine and adjust baseline * add jpeg and zlib to JASPER_LIBS Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com>
2020-04-24 12:19:45 +08:00
diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
index 81db0d92c..51016f3fa 100644
--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
@@ -1,6 +1,6 @@
-if (CMAKE_VERSION VERSION_LESS 3.1.0)
- message(FATAL_ERROR \"Qt 5 $${CMAKE_MODULE_NAME} module requires at least CMake version 3.1.0\")
+if (CMAKE_VERSION VERSION_LESS 3.6.0) # Increase for cmake_parse_arguments
+ message(FATAL_ERROR \"Qt 5 $${CMAKE_MODULE_NAME} module requires at least CMake version 3.6.0\")
endif()
!!IF !isEmpty(CMAKE_USR_MOVE_WORKAROUND)
@@ -34,6 +34,167 @@ set(Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING "$$eval(QT.$${MODULE}.VERSION)")
set(Qt5$${CMAKE_MODULE_NAME}_LIBRARIES Qt5::$${CMAKE_MODULE_NAME})
!!ENDIF // TEMPLATE != aux
+###### Added by VCPKG
+function(_qt5_$${CMAKE_MODULE_NAME}_parse_prl)
+ cmake_parse_arguments(_qt_prl \"\" \"CONFIGURATION;TARGET;PRL_FILE;LIB_FILE;OUT_DEPS;OUT_FLAGS\" \"\" ${ARGN})
+ if(NOT _qt_prl_CONFIGURATION)
+ message(FATAL_ERROR \"qt_parse_prl requires parameter CONFIGURATION\")
+ endif()
+ if(NOT _qt_prl_TARGET)
+ message(FATAL_ERROR \"qt_parse_prl requires parameter TARGET\")
+ endif()
+ if(NOT _qt_prl_PRL_FILE AND NOT _qt_prl_LIB_FILE)
+ message(FATAL_ERROR \"qt_parse_prl requires parameter PRL_FILE or LIB_FILE\")
+ endif()
+ if(NOT _qt_prl_OUT_DEPS)
+ message(FATAL_ERROR \"qt_parse_prl requires parameter OUT_DEPS\")
+ endif()
+ if(NOT _qt_prl_OUT_FLAGS)
+ message(FATAL_ERROR \"qt_parse_prl requires parameter OUT_FLAGS\")
+ endif()
+
+ if(_qt_prl_LIB_FILE)
+ set(_parsed_prl \"${_qt_prl_LIB_FILE}\")
+ string(REGEX REPLACE \"${CMAKE_STATIC_LIBRARY_SUFFIX}$\" \".prl\" _parsed_prl \"${_parsed_prl}\")
+ else()
+ set(_parsed_prl \"${_qt_prl_PRL_FILE}\")
+ endif()
+
+ #message(STATUS \"Reading file: ${_parsed_prl}\")
+ if(NOT EXISTS \"${_parsed_prl}\")
+ message(FATAL_ERROR \"Could not find PRL file: ${_parsed_prl}\")
+ endif()
+ file(STRINGS \"${_parsed_prl}\" _static_depends REGEX \"^QMAKE_PRL_LIBS[ \\t]+=[ \\t]+.+$\")
+ #message(STATUS \"QMAKE_PRL_LIBS from ${_parsed_prl} as read : ${_static_depends}\n\n\")
+ string(REGEX REPLACE \"QMAKE_PRL_LIBS[ \\t]+=[ \\t]+\" \"\" _static_depends \"${_static_depends}\")
+ string(REGEX REPLACE \" -L\\\\$\\\\$([^ ]+)\" [[ ;-L\$\$\\1; ]] _static_depends \"${_static_depends}\") # - L Normal Case
+ if(WIN32)
+ string(REGEX REPLACE \"-L\\\\\\\"([^\\\\\\\"]+)\\\\\\\"\" \" ;-L\\\"\\\\1\\\"; \" _static_depends \"${_static_depends}\") # -L Tricky Case with spaces
+ string(REGEX REPLACE [[\\\"?[A-Z]:\\\\\\\\Program Files( \\(x86\\))*\\\\\\\\Windows Kits\\\\\\\\[0-9]+\\\\\\\\lib\\\\\\\\[0-9|.]+\\\\\\\\um\\\\\\\\x64(\\\\\\\\|/)([^\\\"]+)\\\"?]] \";\\\\3;\" _static_depends \"${_static_depends}\")
+ string(REGEX REPLACE [[ \\\"([^\\"]+)\\\" ]] \" ;\\\"\\\\1\\\"; \" _static_depends \"${_static_depends}\")
+ # Every path with a space in it should be handled now!
+ else()
+ string(REGEX REPLACE \" -l([^ ]+)\" [[;-l\\1;]] _static_depends \"${_static_depends}\") # - l case on targets other than windows
+ endif()
+ string(REGEX REPLACE \"[\\t ]+[^\\\\\\\"]([^( |\\\\\\\")]+)[^\\\\\\\"]([\\t ]+|[\\t ]*$)\" \";\\\\0; \" _static_depends \"${_static_depends}\")
+ string(REGEX REPLACE \"[\\t ]*;[\\t ]*\" \";\" _static_depends \"${_static_depends}\") # remove unnecessary whitespaces
+ string(REGEX REPLACE \"(;[\\t ]*;)+\" \";\" _static_depends \"${_static_depends}\") # remove empty elements from the list
+ #string(REGEX REPLACE \" [\\"]\" \";\\\\\\\"\" _static_depends \"${_static_depends}\")
+ #message(STATUS \"QMAKE_PRL_LIBS as a list : ${_static_depends}\n\n\")
+
+ #Logic Backported from Qt 5.14
+ set(_search_paths)
+ set(_fw_search_paths)
+ set(_framework_flag)
+ if(\"${_qt_prl_CONFIGURATION}\" STREQUAL \"DEBUG\")
+ set(_prl_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/debug/$${CMAKE_LIB_DIR}${LIB_LOCATION}\")
+ else()
+ set(_prl_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}${LIB_LOCATION}\")
+ endif()
+ string(REPLACE \"\$\$[QT_INSTALL_LIBS]/\" \"${_prl_location}\" _static_depends \"${_static_depends}\")
+ string(REGEX REPLACE \"[ \t]+\" \";\" _standard_libraries \"${CMAKE_CXX_STANDARD_LIBRARIES}\")
+ foreach(_flag IN LISTS _static_depends)
+ if(_flag MATCHES \"^-framework$\")
+ # Handle the next flag as framework name
+ set(_framework_flag 1)
+ elseif(_flag MATCHES \"^-F(.*)$\")
+ # Handle -F/foo/bar flags by recording the framework search paths to be used
+ # by find_library.
+ list(APPEND _fw_search_paths \"${CMAKE_MATCH_1}\")
+ elseif(_framework_flag OR _flag MATCHES \"^-l(.*)$\")
+ if(_framework_flag)
+ # Handle Darwin framework bundles passed as -framework Foo
+ unset(_framework_flag)
+ set(_lib ${_flag})
+ else()
+ # Handle normal libraries passed as -lfoo
+ set(_lib \"${CMAKE_MATCH_1}\")
+ foreach(_standard_library ${_standard_libraries})
+ if(_standard_library MATCHES \"^${_lib}(\\\\.lib)?$\")
+ set(_lib_is_default_linked TRUE)
+ break()
+ endif()
+ endforeach()
+ endif()
+ if (_lib_is_default_linked)
+ unset(_lib_is_default_linked)
+ elseif(_lib MATCHES \"^pthread$\")
+ find_package(Threads REQUIRED)
+ list(APPEND _lib_deps Threads::Threads)
+ else()
+ set(current_search_paths \"${_search_paths}\")
+ if(_framework_flag)
+ set(current_search_paths \"${_fw_search_paths}\")
+ endif()
+ if(current_search_paths)
+ find_library(_Qt5$${CMAKE_MODULE_NAME}_${Configuration}_${_lib}_PATH ${_lib} HINTS ${current_search_paths} NO_DEFAULT_PATH)
+ endif()
+ find_library(_Qt5$${CMAKE_MODULE_NAME}_${Configuration}_${_lib}_PATH ${_lib})
+ mark_as_advanced(_Qt5$${CMAKE_MODULE_NAME}_${Configuration}_${_lib}_PATH)
+ if(_Qt5$${CMAKE_MODULE_NAME}_${Configuration}_${_lib}_PATH)
+ list(APPEND _lib_deps
+ ${_Qt5$${CMAKE_MODULE_NAME}_${Configuration}_${_lib}_PATH}
+ )
+ else()
+ message(FATAL_ERROR \"Library not found: ${_lib}\")
+ endif()
+ unset(_framework_flag)
+ endif()
+ elseif(EXISTS \"${_flag}\")
+ # The flag is an absolute path to an existing library
+ list(APPEND _lib_deps \"${_flag}\")
+ elseif(_flag MATCHES \"^-L(.*)$\")
+ # Handle -Lfoo flags by putting their paths in the search path used by find_library above
+ list(APPEND _search_paths \"${CMAKE_MATCH_1}\")
+ elseif(_flag MATCHES \"\\\.(lib|a|so)$\") #Library name only. No -l. Probably missing some cases
+ #message(STATUS \"Added to link deps (${Configuration}): ${_flag}\")
+ list(APPEND _lib_deps ${_flag}) # changed from _link_flags
+ else()
+ # Handle all remaining flags by simply passing them to the linker
+ #message(STATUS \"Added to link flags (${Configuration}): ${_flag}\")
+ list(APPEND _lib_flags ${_flag}) # changed from _link_flags
+ endif()
+ endforeach()
+
+ #message(STATUS \"${_qt_prl_TARGET} links (via PRL ${_qt_prl_CONFIGURATION}): ${_lib_deps}\")
+ #message(STATUS \"${_qt_prl_TARGET} has linker flags (via PRL): ${_lib_flags}\")
+ #get_target_property(_test_interface ${_qt_prl_TARGET} INTERFACE_LINK_LIBRARIES)
+ #message(STATUS \"INTERFACE_LINK_LIBRARIES of target before ${_qt_prl_TARGET}: ${_test_interface} \")
+ set(_prl_out_libs)
+ foreach(_prl_lib IN LISTS _lib_deps)
+ if(\"${_qt_prl_CONFIGURATION}\" STREQUAL \"DEBUG\")
+ #message(STATUS \"DEBUG: ${_prl_lib}\")
+ #set_property(TARGET ${_qt_prl_TARGET} APPEND PROPERTY INTERFACE_LINK_LIBRARIES \"\\$<\\$<CONFIG:DEBUG>:${_prl_lib}>\")
+ list(APPEND _prl_out_libs \"\\$<\\$<CONFIG:DEBUG>:${_prl_lib}>\")
+ else()
+ #message(STATUS \"RELEASE: ${_prl_lib}\")
+ #set_property(TARGET ${_qt_prl_TARGET} APPEND PROPERTY INTERFACE_LINK_LIBRARIES \"\\$<\\$<NOT:\\$<CONFIG:DEBUG>>:${_prl_lib}>\")
+ list(APPEND _prl_out_libs \"\\$<\\$<NOT:\\$<CONFIG:DEBUG>>:${_prl_lib}>\")
+ endif()
+ endforeach()
+ set(${_qt_prl_OUT_DEPS} "${_prl_out_libs}" PARENT_SCOPE)
+ unset(_prl_lib)
+
+ set(_prl_out_flags)
+ foreach(_prl_flag IN LISTS _lib_flags)
+ if(\"${_qt_prl_CONFIGURATION}\" STREQUAL \"DEBUG\")
+ #set_property(TARGET ${_qt_prl_TARGET} APPEND PROPERTY INTERFACE_LINK_LIBRARIES \"\\$<\\$<CONFIG:DEBUG>:${_prl_flag}>\")
+ list(APPEND _prl_out_flags \"\\$<\\$<CONFIG:DEBUG>:${_prl_flag}>\")
+ else()
+ #set_property(TARGET ${_qt_prl_TARGET} APPEND PROPERTY INTERFACE_LINK_LIBRARIES \"\\$<\\$<NOT:\\$<CONFIG:DEBUG>>:${_prl_flag}>\")
+ list(APPEND _prl_out_flags \"\\$<\\$<NOT:\\$<CONFIG:DEBUG>>:${_prl_flag}>\")
+ endif()
+ endforeach()
+ set(${_qt_prl_OUT_FLAGS} "${_prl_out_flags}" PARENT_SCOPE)
+ unset(_prl_flag)
+
+ #get_target_property(_test_interface ${_qt_prl_TARGET} INTERFACE_LINK_LIBRARIES)
+ #message(STATUS \"INTERFACE_LINK_LIBRARIES of target after ${_qt_prl_TARGET}: ${_test_interface} \")
+endfunction()
+
+###### END Added by VCPKG
+
+
macro(_qt5_$${CMAKE_MODULE_NAME}_check_file_exists file)
if(NOT EXISTS \"${file}\" )
message(FATAL_ERROR \"The imported target \\\"Qt5::$${CMAKE_MODULE_NAME}\\\" references the file
@@ -52,6 +189,24 @@ endmacro()
macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATION IMPLIB_LOCATION)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
+!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
+!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
+ if(\"${Configuration}\" STREQUAL \"DEBUG\")
+ set(imported_implib \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/debug/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
+ else()
+ set(imported_implib \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
+ endif()
+!!ELSE
+ set(imported_implib \"IMPORTED_IMPLIB_${Configuration}\" \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
+!!ENDIF
+ _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_implib})
+ if(NOT \"${IMPLIB_LOCATION}\" STREQUAL \"\")
+ set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
+ \"IMPORTED_IMPLIB_${Configuration}\" ${imported_implib}
+ )
+ endif()
+!!ENDIF
+
!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
if(\"${Configuration}\" STREQUAL \"DEBUG\")
set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/debug/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
@@ -60,35 +215,24 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI
endif()
!!ELSE
set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
+!!ENDIF
+!!IF !isEmpty(CMAKE_STATIC_TYPE)
+ _qt5_$${CMAKE_MODULE_NAME}_parse_prl(TARGET Qt5::$${CMAKE_MODULE_NAME} LIB_FILE \"${imported_location}\" CONFIGURATION \"${Configuration}\" OUT_DEPS PRL_DEPS OUT_FLAGS PRL_FLAGS)
+!!ELSE
+ _qt5_$${CMAKE_MODULE_NAME}_parse_prl(TARGET Qt5::$${CMAKE_MODULE_NAME} LIB_FILE \"${imported_implib}\" CONFIGURATION \"${Configuration}\" OUT_DEPS PRL_DEPS OUT_FLAGS PRL_FLAGS)
!!ENDIF
_qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
+ set_property(TARGET ${_qt_prl_TARGET} APPEND PROPERTY INTERFACE_LINK_LIBRARIES \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES};${PRL_DEPS};${PRL_FLAGS}\")
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
- \"INTERFACE_LINK_LIBRARIES\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}\"
+ #\"INTERFACE_LINK_LIBRARIES\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES};${PRL_DEPS};${PRL_FLAGS}\"
\"IMPORTED_LOCATION_${Configuration}\" ${imported_location}
!!IF !isEmpty(CMAKE_LIB_SONAME)
\"IMPORTED_SONAME_${Configuration}\" \"$${CMAKE_LIB_SONAME}\"
!!ENDIF
# For backward compatibility with CMake < 2.8.12
- \"IMPORTED_LINK_INTERFACE_LIBRARIES_${Configuration}\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}\"
+ \"IMPORTED_LINK_INTERFACE_LIBRARIES_${Configuration}\" \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES};${PRL_DEPS};${PRL_FLAGS}\"
)
-!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
-!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
- if(\"${Configuration}\" STREQUAL \"DEBUG\")
- set(imported_implib \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/debug/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
- else()
- set(imported_implib \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
- endif()
-!!ELSE
- set(imported_implib \"IMPORTED_IMPLIB_${Configuration}\" \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
-!!ENDIF
- _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_implib})
- if(NOT \"${IMPLIB_LOCATION}\" STREQUAL \"\")
- set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
- \"IMPORTED_IMPLIB_${Configuration}\" ${imported_implib}
- )
- endif()
-!!ENDIF
endmacro()
!!ENDIF
@@ -366,6 +510,8 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
set_target_properties(Qt5::${Plugin} PROPERTIES
\"IMPORTED_LOCATION_${Configuration}\" ${imported_location}
)
+ _qt5_$${CMAKE_MODULE_NAME}_parse_prl(TARGET Qt5::${Plugin} LIB_FILE \"${imported_location}\" CONFIGURATION \"${Configuration}\" OUT_DEPS PRL_DEPS OUT_FLAGS PRL_FLAGS)
+ set_property(TARGET Qt5::${Plugin} APPEND PROPERTY INTERFACE_LINK_LIBRARIES \"${PRL_DEPS};${PRL_FLAGS}\")
endmacro()
if (pluginTargets)