title: How to link to the C math library with CMake?
body: <p>How do I add the <code>math</code> library to my CMake file? This <a href="https://stackoverflow.com/questions/33639775/clion-cmake-how-to-add-library-so">post</a> references adding a <a href="https://devnet.jetbrains.com/thread/472180" rel="noreferrer">target link library</a>, yet I am not too familiar with C. An <a href="https://stackoverflow.com/questions/11783932/how-to-add-linker-or-compile-flag-in-cmake-file">Additional post</a> - Could someone please demonstrate an example. <a href="https://cmake.org/cmake/help/v3.0/command/target_link_libraries.html" rel="noreferrer">Documentation</a> I am using C and I receive an <code>undefined reference to 'pow'</code> with the pow method of the math header.</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.3)
  project(CSCI-E-28-Unix-Linux-Systems-Programming)
  
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
  
  set(SOURCE_FILES
      CMakeLists.txt
      getchar.c
      main.cpp
          hw0
      more01.c)
  
  #target_link_libraries(&lt;math.h&gt; m)
  
  add_executable(main main.cpp)
  add_executable(getchar getchar.c)
  add_executable(more01 more01.c)
  add_executable(argu print_all_arguments.c)
  add_executable(chars chars.c)
  add_executable(ch4 ch4.c)
  </code></pre>