title: CMake undefined reference to main
body: <p>When I try to compile my program with <code>make</code>, I am getting an undefined reference to main error. Yet, main exists within my src directory, and I feel lost as to what I'm doing wrong.</p>
  
  <p>I assume that <code>add_executable([title] [source])</code> is the command used to add source files to the compilation. </p>
  
  <p><strong>Based on the cmake tutorial</strong></p>
  
  <pre><code>cmake_minimum_required(VERSION 2.6)
  project(opengl_02)
  add_executable(opengl_02 opengl_02.cpp)
  add_executable(main main.cpp)
  add_executable(geometrics geometrics.cpp)
  set (opengl_02_version_major 1)
  set (openfl_02_version_minor 0)
  
  #configure the header file to pass some of the CMake settings 
  #to the source code
  
  configure_file(
      "${PROJECT_SOURCE_DIR}/opengl_02_config.h.in"
      "${PROJECT_BINARY_DIR}/opengl_02_config.h"
      )
  
  #add the binary tree to the search path for include files
  #so that it will find tutorialconfig.h
  
  include_directories("{PROJECT_BINARY_DIR}")
  
  add_executable(opengl_02_config opengl_02_config.cpp)
  </code></pre>
  
  <p><strong>Question</strong></p>
  
  <p>Why is my main file not getting referenced?</p>