Skip to content

Commit 51cef26

Browse files
committed
Merge pull request opencv#10048 from alalek:fix_macos_pkg_config
2 parents a0c658b + a0e1def commit 51cef26

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cmake/OpenCVUtils.cmake

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,10 @@ endfunction()
10011001

10021002
macro(ocv_get_libname var_name)
10031003
get_filename_component(__libname "${ARGN}" NAME)
1004-
string(REGEX REPLACE "^lib(.+).(a|so)(.[.0-9]+)?$" "\\1" __libname "${__libname}")
1004+
# libopencv_core.so.3.3 -> opencv_core
1005+
string(REGEX REPLACE "^lib(.+)\\.(a|so)(\\.[.0-9]+)?$" "\\1" __libname "${__libname}")
1006+
# MacOSX: libopencv_core.3.3.1.dylib -> opencv_core
1007+
string(REGEX REPLACE "^lib(.+[^.0-9])\\.([.0-9]+\\.)?dylib$" "\\1" __libname "${__libname}")
10051008
set(${var_name} "${__libname}")
10061009
endmacro()
10071010

0 commit comments

Comments
 (0)