title: CMakeLists.txt in project with multiple files
body: <p><a href="https://i.stack.imgur.com/mezRn.png" rel="nofollow noreferrer">linking errors.</a>
  Hellow. I have a project with eight .c and eight .h files. How should i write CMakeLists.txt to solve include dependences for all of them? Creating libraries isn't the way, because every file depends on some others.
  Thank you!</p>
  
  <p>My CMakeLists.txt was like </p>
  
  <pre><code>  cmake_minimum_required(VERSION 2.8)
    project(calc-2.4.0)
    set(SOURCE_EXE main.c expmath.c interface.c container.c
    polnot.c error.c getelem.c dbg.c
    buildctrl.h expmath.h interface.h container.h
    polnot.h error.h getelem.h dbg.h)
    add_definitions(-Wall -O2)
    add_executable(calc ${SOURCE_EXE})
  </code></pre>
  
  <p>and</p>
  
  <pre><code>cmake_minimum_required(VERSION 2.8)
  project(calc-2.4.0)
  set(SOURCE_EXE main.c expmath.c interface.c container.c
  polnot.c error.c getelem.c dbg.c)
  add_definitions(-Wall -O2)
  add_executable(calc ${SOURCE_EXE})
  </code></pre>
  
  <p>So linter can't see definitions anyway.</p>