title: cmake returning error of "undefined reference to pthread_create"
body: <p>I am trying to build webrtc project: <a href="https://github.com/mpromonet/webrtc-streamer?fbclid=IwAR2HBwWIZvRhSlmKBllQj2knaBPn6oeEvS24STPLTZHbky2Ta5sbcoPCoc8" rel="nofollow noreferrer">https://github.com/mpromonet/webrtc-streamer?fbclid=IwAR2HBwWIZvRhSlmKBllQj2knaBPn6oeEvS24STPLTZHbky2Ta5sbcoPCoc8</a></p>
  <p>when I run <code>cmake .</code> I got the following error:</p>
  <pre><code>WEBRTCBUILD = Release
  WEBRTCROOT = /home/mohamed/Desktop/upwork/SoftwareExperts/test3/webrtc-streamer/../webrtc
  WEBRTCDESKTOPCAPTURE= ON
  CMAKE_CXX_COMPILER_ID=GNU
  ALSA_FOUND = FALSE
  CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
  Please set them or make sure they are set and tested correctly in the CMake files:
  WEBRTC_LIBRARY
      linked by target &quot;webrtc-streamer&quot; in directory /home/mohamed/Desktop/upwork/SoftwareExperts/test3/webrtc-streamer
  
  -- Configuring incomplete, errors occurred!
  See also &quot;/home/mohamed/Desktop/upwork/SoftwareExperts/test3/webrtc-streamer/CMakeFiles/CMakeOutput.log&quot;.
  See also &quot;/home/mohamed/Desktop/upwork/SoftwareExperts/test3/webrtc-streamer/CMakeFiles/CMakeError.log&quot;.
  </code></pre>
  <p>And hereafter the content of <strong>&quot;CMakeError.log&quot;</strong></p>
  <pre><code>Determining if the pthread_create exist failed with the following output:
  Change Dir: /home/mohamed/Desktop/upwork/SoftwareExperts/test3/webrtc-streamer/CMakeFiles/CMakeTmp
  
  Run Build Command:&quot;/usr/bin/make&quot; &quot;cmTC_13271/fast&quot;
  /usr/bin/make -f CMakeFiles/cmTC_13271.dir/build.make CMakeFiles/cmTC_13271.dir/build
  make[1]: Entering directory '/home/mohamed/Desktop/upwork/SoftwareExperts/test3/webrtc-streamer/CMakeFiles/CMakeTmp'
  Building C object CMakeFiles/cmTC_13271.dir/CheckSymbolExists.c.o
  /usr/bin/cc    -fPIE   -o CMakeFiles/cmTC_13271.dir/CheckSymbolExists.c.o   -c /home/mohamed/Desktop/upwork/SoftwareExperts/test3/webrtc-streamer/CMakeFiles/CMakeTmp/CheckSymbolExists.c
  Linking C executable cmTC_13271
  /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_13271.dir/link.txt --verbose=1
  /usr/bin/cc       CMakeFiles/cmTC_13271.dir/CheckSymbolExists.c.o  -o cmTC_13271 -rdynamic 
  CMakeFiles/cmTC_13271.dir/CheckSymbolExists.c.o: In function `main':
  CheckSymbolExists.c:(.text+0x1b): undefined reference to `pthread_create'
  collect2: error: ld returned 1 exit status
  CMakeFiles/cmTC_13271.dir/build.make:97: recipe for target 'cmTC_13271' failed
  make[1]: *** [cmTC_13271] Error 1
  make[1]: Leaving directory '/home/mohamed/Desktop/upwork/SoftwareExperts/test3/webrtc-streamer/CMakeFiles/CMakeTmp'
  Makefile:126: recipe for target 'cmTC_13271/fast' failed
  make: *** [cmTC_13271/fast] Error 2
  
     
  File /home/mohamed/Desktop/upwork/SoftwareExperts/test3/webrtc-streamer/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
  /* */
  #include &lt;pthread.h&gt;
  
  int main(int argc, char** argv)
  {
    (void)argv;
  #ifndef pthread_create
    return ((int*)(&amp;pthread_create))[argc];
  #else
    (void)argc;
    return 0;
  #endif
  }
  </code></pre>
  <p>Here after the CMakeLists.txt: <a href="https://github.com/mpromonet/webrtc-streamer/blob/master/CMakeLists.txt" rel="nofollow noreferrer">https://github.com/mpromonet/webrtc-streamer/blob/master/CMakeLists.txt</a></p>
  <p>the pthread library is installed on my ubuntu PC because compiling a test file &quot;test.c&quot; with -lpthread is working without problem</p>
  <p>What I am missing ?</p>