title: Can't bind OpenCV to my project via CMake in CLion
body: <p>For an exercise at school I need to work with OpenCV, but I can't figure out how I can link this in CLion.</p>
  <p>I have chosen to put the entire OpenCV library in my project so that I can easily zip it and share with classmates.</p>
  <p>There are no errors in my code and autocomplete can find the files and I can use the content of those files (call functions and such), but when I want to compile, it fails and tells me it cant find the definition of those functions (LNK2019).</p>
  <p>I have been trying this approach for several hours already, and have had this problem for about a week now, and what I could find on the internet is not what I am searching for.</p>
  <p>My CMakeLists.txt:</p>
  <pre><code>cmake_minimum_required(VERSION 3.22)
  project(opencv_template)
  
  set(CMAKE_CXX_STANDARD 14)
  
  add_executable(opencv_template main.cpp)
  
  include_directories(lib/opencv/build/include)
  
  set(MODULE_PATH lib/opencv/sources/modules)
  
  file(GLOB sources_list ${MODULE_PATH}/*)
  foreach(dir ${sources_list})
      if(IS_DIRECTORY ${dir})
          message(STATUS &quot;path=${dir}&quot;)
          include_directories(${dir}/include)
          link_directories(${dir}/src)
      endif()
  endforeach()
  </code></pre>