[opencv] 35/53: cmake: fix libname for pkg-config configuration

Nobuhiro Iwamatsu iwamatsu at moszumanska.debian.org
Sun Aug 27 23:27:06 UTC 2017


This is an automated email from the git hooks/post-receive script.

iwamatsu pushed a commit to annotated tag 2.4.13.3
in repository opencv.

commit 70489b1e2232ead1701519e35d151670b74c3f70
Author: Alexander Alekhin <alexander.alekhin at intel.com>
Date:   Thu Jun 22 19:34:50 2017 +0300

    cmake: fix libname for pkg-config configuration
---
 cmake/OpenCVGenPkgconfig.cmake | 4 ++--
 cmake/OpenCVUtils.cmake        | 6 ++++++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/cmake/OpenCVGenPkgconfig.cmake b/cmake/OpenCVGenPkgconfig.cmake
index 4c46e66..c3a6b45 100644
--- a/cmake/OpenCVGenPkgconfig.cmake
+++ b/cmake/OpenCVGenPkgconfig.cmake
@@ -74,8 +74,8 @@ if(OpenCV_EXTRA_COMPONENTS)
       list(APPEND OpenCV_LIB_COMPONENTS_ "${extra_component}")
     elseif(extra_component MATCHES "[\\/]")
       get_filename_component(libdir "${extra_component}" PATH)
-      get_filename_component(libname "${extra_component}" NAME_WE)
-      string(REGEX REPLACE "^lib" "" libname "${libname}")
+      get_filename_component(libname "${extra_component}" NAME)
+      ocv_get_libname(libname "${libname}")
       list(APPEND OpenCV_LIB_COMPONENTS_ "-L${libdir}" "-l${libname}")
     else()
       list(APPEND OpenCV_LIB_COMPONENTS_ "-l${extra_component}")
diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake
index 55a7acd..6be808c 100644
--- a/cmake/OpenCVUtils.cmake
+++ b/cmake/OpenCVUtils.cmake
@@ -749,6 +749,12 @@ function(ocv_source_group group)
   source_group(${group} FILES ${srcs})
 endfunction()
 
+macro(ocv_get_libname var_name)
+  get_filename_component(__libname "${ARGN}" NAME)
+  string(REGEX REPLACE "^lib(.+).(a|so)(.[.0-9]+)?$" "\\1" __libname "${__libname}")
+  set(${var_name} "${__libname}")
+endmacro()
+
 # build the list of simple dependencies, that links via "-l"
 #  _all_libs - name of variable with input list
 #  _simple - name of variable with output list of simple libs

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opencv.git



More information about the debian-science-commits mailing list