Repository: opencv
Issue: Link OpenCV with Cmake FetchContent
Labels: priority: low,category: build/install

<!--
If you have a question rather than reporting a bug please go to https://forum.opencv.org where you get much faster responses.
If you need further assistance please read [How To Contribute](https://github.com/opencv/opencv/wiki/How_to_contribute).

This is a template helping you to create an issue which can be processed as quickly as possible. This is the bug reporting section for the OpenCV library.
-->

##### System information (version)
- OpenCV => 4.5.3
- Operating System / Platform => Manjaro Linux
- Compiler => g++/gcc 11.1.0


##### Detailed description

<!-- your description -->
I tried to link OpenCV with cmake FetchContent, but it seems as the include directories are not set automatically. I'm always getting the error that the header files, I want to include, can't be found, although the lib is building so far, and even VSCode is suggesting me the header files. So my ticket is a question and an issue. I would be very pleased if someone could help me to fix my error and could you please fix the cmake files to optimize the usage with FetchContent and use the target commands?

```
/home/julian/CppSteg/include/CppSteg/LeastBit.hpp:12:10: fatal error: opencv2/core/mat.hpp: No such file or directory
   12 | #include <opencv2/core/mat.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [examples/basicExample/CMakeFiles/CppSteg_basic_usage.dir/build.make:76: examples/basicExample/CMakeFiles/CppSteg_basic_usage.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:4177: examples/basicExample/CMakeFiles/CppSteg_basic_usage.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
```

##### Steps to reproduce

<!-- to add code example fence it with triple backticks and optional file extension
    ```.cpp
    // C++ code example
    ```
 or attach as .txt or .zip file
-->
My CMakeLists.txt
```cmake
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)

project(CppSteg
	LANGUAGES CXX
	VERSION 0.0.1
)

# Fetch from git
include(FetchContent)

add_library(${PROJECT_NAME} INTERFACE)


target_include_directories(
	${PROJECT_NAME}
	INTERFACE
	${CMAKE_CURRENT_SOURCE_DIR}/include
)

target_compile_features(
	${PROJECT_NAME}
	INTERFACE
	cxx_std_11
)
  
FetchContent_Declare(
        opencv
        GIT_REPOSITORY https://github.com/opencv/opencv.git
        GIT_TAG        4.5.3
)
FetchContent_MakeAvailable(opencv)
include_directories(${OpenCV_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} INTERFACE 
	opencv_core
	opencv_imgcodecs
	)
```

##### Issue submission checklist

 - [x] I report the issue, it's not a question
   <!--
   OpenCV team works with forum.opencv.org, Stack Overflow and other communities
   to discuss problems. Tickets with question without real issue statement will be
   closed.
   -->
 - [x] I checked the problem with documentation, FAQ, open issues,
       forum.opencv.org, Stack Overflow, etc and have not found solution
   <!--
   Places to check:
   * OpenCV documentation: https://docs.opencv.org
   * FAQ page: https://github.com/opencv/opencv/wiki/FAQ
   * OpenCV forum: https://forum.opencv.org
   * OpenCV issue tracker: https://github.com/opencv/opencv/issues?q=is%3Aissue
   * Stack Overflow branch: https://stackoverflow.com/questions/tagged/opencv
   -->
 - [x] I updated to latest OpenCV version and the issue is still there
   <!--
   master branch for OpenCV 4.x and 3.4 branch for OpenCV 3.x releases.
   OpenCV team supports only latest release for each branch.
   The ticket is closed, if the problem is not reproduced with modern version.
   -->
 - [x] There is reproducer code and related data files: videos, images, onnx, etc
   <!--
   The best reproducer -- test case for OpenCV that we can add to the library.
   Recommendations for media files and binary files:
   * Try to reproduce the issue with images and videos in opencv_extra repository
     to reduce attachment size
   * Use PNG for images, if you report some CV related bug, but not image reader
     issue
   * Attach the image as archive to the ticket, if you report some reader issue.
     Image hosting services compress images and it breaks the repro code.
   * Provide ONNX file for some public model or ONNX file with with random weights,
     if you report ONNX parsing or handling issue. Architecture details diagram
     from netron tool can be very useful too. See https://lutzroeder.github.io/netron/
   -->