|
|
@ -1003,6 +1003,13 @@ function(ocv_add_library target) |
|
|
|
_ocv_append_target_includes(${target}) |
|
|
|
_ocv_append_target_includes(${target}) |
|
|
|
endfunction() |
|
|
|
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 opencv libs and dependencies for all modules |
|
|
|
# build the list of opencv libs and dependencies for all modules |
|
|
|
# _modules - variable to hold list of all modules |
|
|
|
# _modules - variable to hold list of all modules |
|
|
|
# _extra - variable to hold list of extra dependencies |
|
|
|
# _extra - variable to hold list of extra dependencies |
|
|
@ -1030,11 +1037,31 @@ macro(ocv_get_all_libs _modules _extra _3rdparty) |
|
|
|
foreach (dep ${deps} ${OPENCV_LINKER_LIBS}) |
|
|
|
foreach (dep ${deps} ${OPENCV_LINKER_LIBS}) |
|
|
|
if (NOT DEFINED OPENCV_MODULE_${dep}_LOCATION) |
|
|
|
if (NOT DEFINED OPENCV_MODULE_${dep}_LOCATION) |
|
|
|
if (TARGET ${dep}) |
|
|
|
if (TARGET ${dep}) |
|
|
|
get_target_property(_output ${dep} ARCHIVE_OUTPUT_DIRECTORY) |
|
|
|
get_target_property(_type ${dep} TYPE) |
|
|
|
if ("${_output}" STREQUAL "${3P_LIBRARY_OUTPUT_PATH}") |
|
|
|
if(_type STREQUAL "STATIC_LIBRARY" AND BUILD_SHARED_LIBS) |
|
|
|
list(INSERT ${_3rdparty} 0 ${dep}) |
|
|
|
# nothing |
|
|
|
else() |
|
|
|
else() |
|
|
|
list(INSERT ${_extra} 0 ${dep}) |
|
|
|
get_target_property(_output ${dep} IMPORTED_LOCATION) |
|
|
|
|
|
|
|
if(NOT _output) |
|
|
|
|
|
|
|
get_target_property(_output ${dep} ARCHIVE_OUTPUT_DIRECTORY) |
|
|
|
|
|
|
|
get_target_property(_output_name ${dep} OUTPUT_NAME) |
|
|
|
|
|
|
|
if(NOT _output_name) |
|
|
|
|
|
|
|
set(_output_name "${dep}") |
|
|
|
|
|
|
|
endif() |
|
|
|
|
|
|
|
else() |
|
|
|
|
|
|
|
get_filename_component(_output_name "${_output}" NAME) |
|
|
|
|
|
|
|
endif() |
|
|
|
|
|
|
|
string(FIND "${_output}" "${CMAKE_BINARY_DIR}" _POS) |
|
|
|
|
|
|
|
if (_POS EQUAL 0) |
|
|
|
|
|
|
|
ocv_get_libname(_libname "${_output_name}") |
|
|
|
|
|
|
|
list(INSERT ${_3rdparty} 0 ${_libname}) |
|
|
|
|
|
|
|
else() |
|
|
|
|
|
|
|
if(_output) |
|
|
|
|
|
|
|
list(INSERT ${_extra} 0 ${_output}) |
|
|
|
|
|
|
|
else() |
|
|
|
|
|
|
|
list(INSERT ${_extra} 0 ${dep}) |
|
|
|
|
|
|
|
endif() |
|
|
|
|
|
|
|
endif() |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
else() |
|
|
|
else() |
|
|
|
list(INSERT ${_extra} 0 ${dep}) |
|
|
|
list(INSERT ${_extra} 0 ${dep}) |
|
|
@ -1043,15 +1070,6 @@ macro(ocv_get_all_libs _modules _extra _3rdparty) |
|
|
|
endforeach() |
|
|
|
endforeach() |
|
|
|
endforeach() |
|
|
|
endforeach() |
|
|
|
|
|
|
|
|
|
|
|
# ippicv specific handling |
|
|
|
|
|
|
|
list(FIND ${_extra} "ippicv" ippicv_idx) |
|
|
|
|
|
|
|
if (${ippicv_idx} GREATER -1) |
|
|
|
|
|
|
|
list(REMOVE_ITEM ${_extra} "ippicv") |
|
|
|
|
|
|
|
if(NOT BUILD_SHARED_LIBS) |
|
|
|
|
|
|
|
list(INSERT ${_3rdparty} 0 "ippicv") |
|
|
|
|
|
|
|
endif() |
|
|
|
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ocv_list_filterout(${_modules} "^[\$]<") |
|
|
|
ocv_list_filterout(${_modules} "^[\$]<") |
|
|
|
ocv_list_filterout(${_3rdparty} "^[\$]<") |
|
|
|
ocv_list_filterout(${_3rdparty} "^[\$]<") |
|
|
|
ocv_list_filterout(${_extra} "^[\$]<") |
|
|
|
ocv_list_filterout(${_extra} "^[\$]<") |
|
|
|