title: Single threaded application with Boost and CMake
body: <p><em>I'm writing a single threaded application. I use CMake to compile it. My application is being written in C++ using Boost. When run 'make' linking of my application fails with following error message:</em></p>
  
  <pre><code>Linking CXX executable whisk
  cd &lt;project&gt;/build/src &amp;&amp; /usr/bin/cmake -E cmake_link_script CMakeFiles/whisk.dir/link.txt --verbose=1
  /usr/bin/c++      CMakeFiles/whisk.dir/driver_simdag.cpp.o CMakeFiles/whisk.dir/whisk.cpp.o CMakeFiles/whisk.dir/driver_miror.cpp.o CMakeFiles/whisk.dir/driver.cpp.o CMakeFiles/whisk.dir/main.cpp.o  -o whisk -rdynamic -lboost_program_options 
  /usr/bin/ld: CMakeFiles/whisk.dir/whisk.cpp.o: undefined reference to symbol 'pthread_rwlock_unlock@@GLIBC_2.2.5'
  //lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p><strong>This is the error itself:</strong></p>
  
  <pre><code> undefined reference to symbol 'pthread_rwlock_unlock@@GLIBC_2.2.5'
  </code></pre>
  
  <p><strong>My CMakeLists.txt from the src directory is following:</strong></p>
  
  <pre><code>file(GLOB whisk_SRC "[a-zA-Z]*.cpp")
  add_executable(whisk ${whisk_SRC})
  
  FIND_PACKAGE( Boost 1.40 COMPONENTS program_options log REQUIRED )
  set(Boost_USE_MULTITHREADED      OFF)
  # set_property(TARGET whisk PROPERTY Boost_USE_MULTITHREADED OFF)
  INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIR} )
  
  set_property(TARGET whisk PROPERTY CXX_STANDARD 11)
  set_property(TARGET whisk PROPERTY CXX_STANDARD_REQUIRED ON)
  
  target_link_libraries(whisk ${Boost_PROGRAM_OPTIONS_LIBRARY})
  
  install(TARGETS whisk DESTINATION bin)
  </code></pre>
  
  <p><strong>How do I tell CMake and Boost that I do not pthreads at all and I want single threaded version to be compiled?</strong></p>