title: How to invoke cmake from within sublime text?
body: <p>I'm using:</p>
  
  <ul>
  <li>sublime text 3</li>
  <li>cmake</li>
  <li>make on Mac and mingw-make on windows</li>
  </ul>
  
  <p>So far I'm able to compile and run hello world using cmake and make. I'd like to be able to compile, link and run from within sublime text. By default, I didn't find a build system which allows me to do this.</p>
  
  <p>Also, I understand that sublime text is just an editor but it also provides the notion of a build system where one can plugin your own.</p>
  
  <p>If I run:</p>
  
  <pre><code>cmake .. -G "Sublime Text 2 - MinGW Makefiles"
  </code></pre>
  
  <p>It generates sublime text project file. When I open this project file in sublime, it populates build system with options from the generated make file (using cmake). It builds the executable but none of the build options allows me to run it.</p>
  
  <p>Can someone help me understand how can I make the sublime run the project executable ?</p>
  
  <p>Please let me know if I need to add more details here.</p>
  
  <p>My directory structure is like this:</p>
  
  <ul>
  <li>root
  
  <ul>
  <li>include
  
  <ul>
  <li>linkedlist.h</li>
  </ul></li>
  <li>src
  
  <ul>
  <li>linkedlist.cpp</li>
  </ul></li>
  <li>CMakeLists.txt</li>
  <li>main.cpp</li>
  </ul></li>
  </ul>
  
  <p>My <code>CMakeLists.txt</code> :</p>
  
  <pre><code>cmake_minimum_required(VERSION 2.8.9)
  project(dataStructures)
  
  #Bring the headers, into the project
  include_directories(include)
  
  #Can manually add the sources using the set command as follows:
  set(MAINEXEC main.cpp)
  
  #However, the file(GLOB...) allows for wildcard additions:
  file(GLOB SOURCES "src/*.cpp")
  
  add_executable(testDS ${SOURCES} ${MAINEXEC})
  </code></pre>