diff --git a/cmake/templates/OpenCVConfig.cmake.in b/cmake/templates/OpenCVConfig.cmake.in index ee1eb59969..91791b64a7 100644 --- a/cmake/templates/OpenCVConfig.cmake.in +++ b/cmake/templates/OpenCVConfig.cmake.in @@ -41,7 +41,9 @@ if(ANDROID) string(REPLACE - _ modules_file_suffix "_${ANDROID_NDK_ABI_NAME}") endif() -include(${CMAKE_CURRENT_LIST_DIR}/OpenCVModules${modules_file_suffix}.cmake) +if(NOT TARGET opencv_core) + include(${CMAKE_CURRENT_LIST_DIR}/OpenCVModules${modules_file_suffix}.cmake) +endif() # TODO All things below should be reviewed. What is about of moving this code into related modules (special vars/hooks/files)