1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

cmake: fix libname for pkg-config configuration

This commit is contained in:
Alexander Alekhin
2017-06-22 19:34:50 +03:00
parent e397794ae2
commit 70489b1e22
2 changed files with 8 additions and 2 deletions
+2 -2
View File
@@ -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}")
+6
View File
@@ -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