title: CMake basic usage
body: <p>I'm trying to build my library with CMake. I'm working on CMakeLists.txt .</p>
  
  <p>I want to be able to do the following:</p>
  
  <p>I have a directories called</p>
  
  <pre><code>include
  src
  </code></pre>
  
  <p>Then inside of these there is
  Agui folder.
  And in that folder are the sub folders of the library.</p>
  
  <p>So far from what I've gathered:</p>
  
  <p>I'll need to do:</p>
  
  <pre><code>set(AGUI_SOURCES
  src/Agui/Rectangle.cpp
  src/Agui/xxx.cpp (and so on)
  )
  </code></pre>
  
  <p>Then I think need to do:</p>
  
  <pre><code>include_directories(./include)
  </code></pre>
  
  <p>And then I'm not quite sure.</p>
  
  <p>I know that add_library will be involved but I'm not sure how.</p>
  
  <p>The thing is, I want to create 2 options: DLL, or static.</p>
  
  <p>If it is DLL, then AGUI_BUILD_DLL must be defined.</p>
  
  <p>So based on this information:</p>
  
  <ol>
  <li>Am I on the right track?</li>
  <li>How do I create the options</li>
  <li>What do I put in add_library</li>
  <li>How do I add the preprocessor AGUI_BUILD_DLL if the user wants the DLL version?</li>
  </ol>
  
  <p>If any or all of these could be answered I would greatly appreciate it.</p>
  
  <p>Thanks</p>