title: CMake is unable to find SFML directories in Windows when creating a simple project
body: <p>I recently downloaded CMake for Windows, since I wanted to develop a cross-platform plugin for SFML, and decided to test out how to do so by following a guide, which is <a href="https://blog.beuc.net/posts/Build_a_SFML_project_with_CMake/" rel="nofollow noreferrer">here</a>. As per the guide, I created a folder in my Documents directory called <code>sfml_test_cmake</code> (Windows 10) with a <code>CMakeLists.txt</code>, <code>main.cpp</code> (which has the SFML code), and a folder <code>cmake_modules</code> which would hold a file <a href="https://github.com/SFML/SFML/blob/master/cmake/Modules/FindSFML.cmake" rel="nofollow noreferrer">FindSFML.cmake</a>. The <code>CMakeLists.txt</code> looks as follows:</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.9)
  project(SFML-CmakeTest)
  
  set(EXECUTABLE_NAME "sfml_test_cmake")
  
  add_executable(${EXECUTABLE_NAME} main.cpp)
  
  set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH})
  find_package(SFML 2.4 REQUIRED system window graphics network audio)
  target_link_libraries(${EXECUTABLE_NAME} ${SFML_LIBRARIES})
  
  install(TARGETS ${EXECUTABLE_NAME} DESTINATION bin)
  </code></pre>
  
  <p>and the <code>main.cpp</code>, which is a simple test program looks as follows:</p>
  
  <pre><code>#include &lt;SFML/Graphics.hpp&gt;
  
  int main()
  {
      sf::RenderWindow testWindow{ sf::VideoMode{ 640, 480 }, "Test Window", sf::Style::Default };
  
      while (testWindow.isOpen())
      {
          sf::Event winEvent;
          while (testWindow.pollEvent(winEvent))
          {
              if (winEvent.type == sf::Event::Closed)
              {
                  testWindow.close();
              }
          }
          testWindow.clear();
          testWindow.display();
      }
  }
  </code></pre>
  
  <p>As for where SFML is installed, it is installed in both my Documents directory, and my <code>C:\</code> drive. To finally build the code, I opened <code>cmd.exe</code>, created a new directory inside my folder for the build, and ran <code>cmake ..</code>. The errors I got were:</p>
  
  <pre><code>CMake Error at cmake_modules/FindSFML.cmake:357 (message):
    Could NOT find SFML (missing: SFML_SYSTEM_LIBRARY SFML_WINDOW_LIBRARY
    SFML_GRAPHICS_LIBRARY SFML_NETWORK_LIBRARY SFML_AUDIO_LIBRARY)
  </code></pre>
  
  <p>Upon looking in <code>FindSFML.cmake</code>, I found this:</p>
  
  <pre><code># define the list of search paths for headers and libraries
  set(FIND_SFML_PATHS
      ${SFML_ROOT}
      $ENV{SFML_ROOT}
      ~/Library/Frameworks
      /Library/Frameworks
      /usr/local
      /usr
      /sw
      /opt/local
      /opt/csw
      /opt)
  </code></pre>
  
  <p>Which tells my that Cmake is only searching in the directories it SFML would be in if I was on Linux, explaining why the directories couldn't be found. To fix the problem, I changed the function to the following:</p>
  
  <pre><code># define the list of search paths for headers and libraries
  set(FIND_SFML_PATHS
      ${SFML_ROOT}
      $ENV{SFML_ROOT}
      ~/Library/Frameworks
      /Library/Frameworks
      /usr/local
      /usr
      /sw
      /opt/local
      /opt/csw
      /opt
      C:/)
  </code></pre>
  
  <p>However, this time rebuilding resulted in the same error, leaving my confused. What am I doing wrong?</p>