diff --git a/cmake/OpenCVGenAndroidMK.cmake b/cmake/OpenCVGenAndroidMK.cmake index 5f1002a51..61efd420a 100644 --- a/cmake/OpenCVGenAndroidMK.cmake +++ b/cmake/OpenCVGenAndroidMK.cmake @@ -52,7 +52,9 @@ if(ANDROID) list(INSERT OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE 0 ${mod}) endif() endforeach() - list(REMOVE_ITEM OPENCV_MODULES_CONFIGMAKE ${OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE}) + if(OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE) + list(REMOVE_ITEM OPENCV_MODULES_CONFIGMAKE ${OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE}) + endif() # convert CMake lists to makefile literals foreach(lst OPENCV_MODULES_CONFIGMAKE OPENCV_3RDPARTY_COMPONENTS_CONFIGMAKE OPENCV_EXTRA_COMPONENTS_CONFIGMAKE) diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake index b275235cb..f6cfddc2a 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake @@ -299,6 +299,12 @@ macro(ocv_glob_modules) if(m MATCHES "^opencv_") string(REGEX REPLACE "^opencv_" "" __shortname "${m}") add_subdirectory("${OPENCV_MODULE_${m}_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/${__shortname}") + + #workaround for link_directories inheritance + get_directory_property(__lnkfix DIRECTORY "${OPENCV_MODULE_${m}_LOCATION}" LINK_DIRECTORIES) + if(__lnkfix) + link_directories(${__lnkfix}) + endif() endif() endforeach() unset(__shortname)