title: CMake: library linking requirements
body: <p>I have a project where I build a library called mylibA that uses calls to the pthread library. In my CMake project file I use the following commands:</p>
  
  <pre><code>add_library( mylibA STATIC ${mylib_SRC} )
  target_link_library( mylibA pthread )
  </code></pre>
  
  <p>In a separate project, a create an executable that uses mylibA. My CMake project file looks like the following:</p>
  
  <pre><code>add_executable( myexe ${myexe_SRC} )
  target_link_library( myexe mylibA pthread )
  </code></pre>
  
  <p>If I leave out the pthread link for the executable project, I get encounter link problems. Is it a requirement to link the pthread library against both the library and executable, or am I doing something wrong?</p>