title: How to link external library in Clion/Cmake?
body: <p>I am new to Cmake, and I am having trouble linking an external library (libtiff). I have installed libtiff and it is in my <code>/usr/local/include</code>. Then I used <code>include_directories()</code> and <code>target_linked_libraries()</code> in my Cmake. However, it still gives me</p>
  
  <pre><code>ld: library not found for -ltiff
  </code></pre>
  
  <p>main.c:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include "tiffio.h"
  
  int main() {
      printf("Hello, World!\n");
      return 0;
  }
  </code></pre>
  
  <p>cmake file:</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.13)
  
  project(test2 C)
  
  set(CMAKE_C_STANDARD 99)
  
  include_directories(/usr/local/include)
  
  add_executable(test2 main.c)
  
  target_link_libraries(test2 tiff)
  </code></pre>
  
  <p>I would really appreciate if you can help! Thanks in advance!</p>