summaryrefslogtreecommitdiffstats
path: root/cmake/QtGenerateLibHelpers.cmake
diff options
context:
space:
mode:
authorLi Xinwei <1326710505@qq.com>2021-07-16 16:28:32 +0800
committerLi Xinwei <1326710505@qq.com>2021-07-17 02:42:13 +0800
commit2915921ad2a79a4ce1651dc7297f6571788d1413 (patch)
tree40a9d028c382f7d8272d33291e6e15be131516e6 /cmake/QtGenerateLibHelpers.cmake
parent5ef5dce53bb9f25b79275d1a2d7087b3eabfa792 (diff)
Fix generated pri and prl files
Quote the paths after "-L". Get MSVC’s implicit link directories from $ENV{LIB}. Fix some issues cause by Inconsistent case. Amends 2c49f85380d7ad79d9473e0f42e7afaa36d31af9 Fixes: QTBUG-95198 Pick-to: 6.2 6.1 Change-Id: Ie82f10b088e2764396377726340509f24a4ae8e7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtGenerateLibHelpers.cmake')
-rw-r--r--cmake/QtGenerateLibHelpers.cmake9
1 files changed, 6 insertions, 3 deletions
diff --git a/cmake/QtGenerateLibHelpers.cmake b/cmake/QtGenerateLibHelpers.cmake
index 913b0ed90a..e3f4bbf881 100644
--- a/cmake/QtGenerateLibHelpers.cmake
+++ b/cmake/QtGenerateLibHelpers.cmake
@@ -6,11 +6,12 @@ function(qt_get_library_name_without_prefix_and_suffix out_var file_path)
if(IS_ABSOLUTE "${file_path}")
get_filename_component(basename "${file_path}" NAME_WE)
get_filename_component(ext "${file_path}" EXT)
+ string(TOLOWER "${ext}" ext_lower)
foreach(libsuffix ${LIBRARY_SUFFIXES})
# Handle weird prefix extensions like in the case of
# "/usr/lib/x86_64-linux-gnu/libglib-2.0.so"
# it's ".0.so".
- if(ext MATCHES "^(\\.[0-9]+)*${libsuffix}(\\.[0-9]+)*")
+ if(ext_lower MATCHES "^(\\.[0-9]+)*${libsuffix}(\\.[0-9]+)*")
set(is_linkable_library TRUE)
set(weird_numbered_extension "${CMAKE_MATCH_1}")
break()
@@ -64,11 +65,13 @@ function(qt_transform_absolute_library_paths_to_link_flags out_var library_path_
foreach(library_path ${library_path_list})
qt_get_library_with_link_flag(lib_name_with_link_flag "${library_path}")
if(lib_name_with_link_flag)
+ string(TOLOWER "${IMPLICIT_LINK_DIRECTORIES}" IMPLICIT_LINK_DIRECTORIES_LOWER)
get_filename_component(dir "${library_path}" DIRECTORY)
+ string(TOLOWER "${dir}" dir_lower)
# If library_path isn't in default link directories, we should add it to link flags.
- list(FIND IMPLICIT_LINK_DIRECTORIES ${dir} index)
+ list(FIND IMPLICIT_LINK_DIRECTORIES_LOWER "${dir_lower}" index)
if(${index} EQUAL -1)
- list(APPEND out_list "-L${dir} ")
+ list(APPEND out_list "-L\"${dir}\"")
endif()
list(APPEND out_list "${lib_name_with_link_flag}")
else()