title: CMake linking OpenGL and GLUT library
body: <p>I wrote c++ project in which I am using OpenGL and Glut library.</p>
  
  <p>When I compile it from command line everything works fine.
  Here is sample.</p>
  
  <pre><code>g++ -o prog source.cpp -lGL -lGLU -lglut --std=c++11 -L /usr/lib/nvidia-331/
  </code></pre>
  
  <p>But when I want to use CMake in QtCreator:</p>
  
  <pre><code>project(proj)
  cmake_minimum_required(VERSION 2.8)
  
  aux_source_directory(. SRC_LIST)
  add_executable(${PROJECT_NAME} ${SRC_LIST})
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -lGL -lGLU -lglut -L /usr/lib/nvidia-331/") 
  </code></pre>
  
  <p>I recieve msg: <strong>error: undefined reference to `glColor3f'</strong> and so on.</p>
  
  <p>Can anybody help me?</p>