From 307b36662ec9dcf125a589ca24dd69886698fd2b Mon Sep 17 00:00:00 2001 From: Sharaf Zaman Date: Mon, 15 Apr 2019 05:55:20 +0530 Subject: Bug fix: find c++ stl using regex Summary: Find C++ shared lib path using regex. This change makes finding path independent of the order in which it was added by cmake. Reviewers: apol Reviewed By: apol Subscribers: kde-buildsystem, kde-frameworks-devel Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D20558 --- toolchain/ECMAndroidDeployQt.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'toolchain/ECMAndroidDeployQt.cmake') diff --git a/toolchain/ECMAndroidDeployQt.cmake b/toolchain/ECMAndroidDeployQt.cmake index 25da4a23..41bc1499 100644 --- a/toolchain/ECMAndroidDeployQt.cmake +++ b/toolchain/ECMAndroidDeployQt.cmake @@ -1,3 +1,4 @@ +cmake_minimum_required (VERSION 3.7 FATAL_ERROR) find_package(Qt5Core REQUIRED) function(ecm_androiddeployqt QTANDROID_EXPORTED_TARGET ECM_ADDITIONAL_FIND_ROOT_PATH) @@ -38,10 +39,9 @@ function(ecm_androiddeployqt QTANDROID_EXPORTED_TARGET ECM_ADDITIONAL_FIND_ROOT_ function(havestl var access VALUE) if (NOT VALUE STREQUAL "") - string(FIND "${VALUE}" ".so\"" OUT) - math(EXPR OUT "${OUT}+4") - string(SUBSTRING "${VALUE}" 0 ${OUT} OUTSTR) - file(WRITE ${CMAKE_BINARY_DIR}/stl "${OUTSTR}") + # look for ++ and .so as in libc++.so + string (REGEX MATCH "\"[^ ]+\\+\\+[^ ]*\.so\"" OUT ${VALUE}) + file(WRITE ${CMAKE_BINARY_DIR}/stl "${OUT}") endif() endfunction() function(haveranlib var access VALUE) -- cgit v1.2.1