Fix generation of the Qt5::GLESv2 target on ARM

Since 5.12.1 the library name provided is an absolute path. We need to
take the case into account, otherwise it just fails to build if the
target is used.

Fixes QTBUG-72903

Change-Id: I96407e5fe1831487da77cbe7b24b64dae59b22ff
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
This commit is contained in:
Aleix Pol 2019-02-14 03:09:59 +01:00 committed by Aleix Pol Gonzalez
parent 17a51c4e0d
commit 131c760af6

View File

@ -91,16 +91,29 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs)
endforeach()
!!ENDIF
foreach(_lib ${Libs})
string(REGEX REPLACE "[^_A-Za-z0-9]" "_" _cmake_lib_name ${_lib})
if (IS_ABSOLUTE ${_lib})
get_filename_component(_libFile ${_lib} NAME_WE)
if (_libFile MATCHES \"^${CMAKE_SHARED_LIBRARY_PREFIX}(.*)\")
set(_libFile ${CMAKE_MATCH_1})
endif()
else()
set(_libFile ${_lib})
endif()
string(REGEX REPLACE "[^_A-Za-z0-9]" "_" _cmake_lib_name ${_libFile})
if (NOT TARGET Qt5::Gui_${_cmake_lib_name} AND NOT _Qt5Gui_${_cmake_lib_name}_LIBRARY_DONE)
find_library(Qt5Gui_${_cmake_lib_name}_LIBRARY ${_lib}
if (IS_ABSOLUTE ${_lib})
set(Qt5Gui_${_cmake_lib_name}_LIBRARY ${_lib})
else()
find_library(Qt5Gui_${_cmake_lib_name}_LIBRARY ${_lib}
!!IF !isEmpty(CROSS_COMPILE)
PATHS \"${LibDir}\"
PATHS \"${LibDir}\"
!!IF !mac
NO_DEFAULT_PATH
NO_DEFAULT_PATH
!!ENDIF
!!ENDIF
)
)
endif()
!!IF mac
set(Qt5Gui_${_cmake_lib_name}_LIBRARY "${Qt5Gui_${_cmake_lib_name}_LIBRARY}/${_lib}")
if (NOT EXISTS "${Qt5Gui_${_cmake_lib_name}_LIBRARY}")