diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake index 4a33f3acdf..60501cba03 100644 --- a/cmake/OpenCVUtils.cmake +++ b/cmake/OpenCVUtils.cmake @@ -449,17 +449,15 @@ endmacro() # convert list of paths to libraries names without lib prefix -macro(ocv_convert_to_lib_name var) - set(__tmp "") +function(ocv_convert_to_lib_name var) + set(tmp "") foreach(path ${ARGN}) - get_filename_component(__tmp_name "${path}" NAME_WE) - string(REGEX REPLACE "^lib" "" __tmp_name ${__tmp_name}) - list(APPEND __tmp "${__tmp_name}") + get_filename_component(tmp_name "${path}" NAME_WE) + string(REGEX REPLACE "^lib" "" tmp_name "${tmp_name}") + list(APPEND tmp "${tmp_name}") endforeach() - set(${var} ${__tmp}) - unset(__tmp) - unset(__tmp_name) -endmacro() + set(${var} ${tmp} PARENT_SCOPE) +endfunction() # add install command