Merge pull request #10094 from amroamroamro:mingw-pkgconfig-fix

This commit is contained in:
Alexander Alekhin 2017-11-16 19:39:33 +00:00
commit 6936ec7dbd

View File

@ -1002,7 +1002,7 @@ endfunction()
macro(ocv_get_libname var_name) macro(ocv_get_libname var_name)
get_filename_component(__libname "${ARGN}" NAME) get_filename_component(__libname "${ARGN}" NAME)
# libopencv_core.so.3.3 -> opencv_core # libopencv_core.so.3.3 -> opencv_core
string(REGEX REPLACE "^lib(.+)\\.(a|so)(\\.[.0-9]+)?$" "\\1" __libname "${__libname}") string(REGEX REPLACE "^lib(.+)\\.(a|so|dll)(\\.[.0-9]+)?$" "\\1" __libname "${__libname}")
# MacOSX: libopencv_core.3.3.1.dylib -> opencv_core # MacOSX: libopencv_core.3.3.1.dylib -> opencv_core
string(REGEX REPLACE "^lib(.+[^.0-9])\\.([.0-9]+\\.)?dylib$" "\\1" __libname "${__libname}") string(REGEX REPLACE "^lib(.+[^.0-9])\\.([.0-9]+\\.)?dylib$" "\\1" __libname "${__libname}")
set(${var_name} "${__libname}") set(${var_name} "${__libname}")