title: CMake: GLFW as ExternalProject
body: <h1>Issue</h1>
  <p>I am trying to make a project that uses <a href="http://www.glfw.org/" rel="nofollow noreferrer">GLFW</a>. For this project I am using <a href="http://www.cmake.org/" rel="nofollow noreferrer">CMake</a> as a build system. I would like to make it so the user just has to build my project with CMake, and as part of the process GLFW will get built and linked appropriately.</p>
  <p>To do this I am adding GLFW as a <code>ExternalProject</code> in my CMake file:</p>
  <pre><code>EXTERNALPROJECT_ADD(glfw
      GIT_REPOSITORY https://github.com/glfw/glfw.git
      GIT_TAG 3.1
      INSTALL_DIR &quot;${PROJECT_BINARY_DIR}/libs/glfw&quot;
  )
  </code></pre>
  <p>However when I generate the project(For VS12 2013 x64) and run <code>ALL_BUILD</code> I get the following error:</p>
  <pre><code>2&gt;    CMake Error at cmake_install.cmake:31 (file):
  2&gt;      file INSTALL cannot make directory &quot;C:/Program Files/GLFW/include/GLFW&quot;: No
  2&gt;      such file or directory
  </code></pre>
  <p>I get the same error when I try to build GLFW with CMake without specifying the <code>CMAKE_INSTALL_PREFIX</code>.</p>
  <h1>Attempted Solution</h1>
  <p>To fix this I would like to specify the <code>CMAKE_INSTALL_PREFIX</code> option for the <code>glfw</code> ExternalProject. However I do not seam to be able to do this. I have tried:</p>
  <pre><code>SET_TARGET_PROPERTIES(glfw PROPERTIES CMAKE_INSTALL_PREFIX &quot;${PROJECT_BINARY_DIR}/libs/glfw&quot;)
  </code></pre>
  <p>After adding the ExternalProject. However this seams to have no effect.</p>
  <h1>Question</h1>
  <p>How do I set the <code>CMAKE_INSTALL_PREFIX</code> for the <code>glfw</code> ExternalProject?</p>
  <p>As mentioned by @drescherjm the root of this failure is that CMake is trying to create files in <code>C:/Program Files</code> which it needs special permissions for. The issue is that CMake is defaulting to this location because I am unable to set the correct location in my CMake file.</p>
  <h1>Additional Information</h1>
  <p><strong>OS</strong>: Windows 8.1 x64<br />
  <strong>CMake Version</strong>: 3.1.1<br />
  <strong>Visual Studio Version</strong>: Community 2013 V4.5.53349<br />
  <strong><a href="https://github.com/Noah-Huppert/glib/blob/restart/CMakeLists.txt" rel="nofollow noreferrer">CMake File</a></strong></p>