title: MinGW-w64 can't find Makefile that exists
body: <p>I'm encountering an error in building one of my ExternalProjects:</p>
  
  <blockquote>
  <pre><code>mingw32-make.exe[3]: *** No targets specified and no makefile found.  Stop.
  </code></pre>
  </blockquote>
  
  <p>Here is the <a href="https://github.com/syb0rg/Khronos/blob/master/cmake/Win32-ExternalProjects.txt" rel="nofollow noreferrer">relevant code</a> used to build it within my project:</p>
  
  <pre><code>FIND_PACKAGE(sphinxbase)
  if (${SPHINXBASE_FOUND})
      INCLUDE_DIRECTORIES(${SPHINXBASE_INCLUDE_DIR}/sphinxbase/)
  else ()
      ExternalProject_Add(
          sphinxbase
          GIT_REPOSITORY      "https://github.com/syb0rg/sphinxbase.git"
          #GIT_SHALLOW         TRUE
          SOURCE_DIR          ${CMAKE_BINARY_DIR}/lib/sphinxbase
          UPDATE_COMMAND      ""
          CONFIGURE_COMMAND   ""
          BUILD_IN_SOURCE     ON
          LOG_DOWNLOAD        ON
          LOG_UPDATE          ON
          LOG_CONFIGURE       ON
          LOG_BUILD           ON
          LOG_TEST            ON
          LOG_INSTALL         ON
      )
      ExternalProject_Get_Property(sphinxbase SOURCE_DIR)
      ExternalProject_Get_Property(sphinxbase BINARY_DIR)
      SET(SPHINXBASE_SOURCE_DIR ${SOURCE_DIR})
      SET(SPHINXBASE_BINARY_DIR ${BINARY_DIR})
      SET(SPHINXBASE_LIBRARIES ${SPHINXBASE_SOURCE_DIR}/bin/Debug/x64/sphinxbase.lib)
      SET(DEPENDENCIES ${DEPENDENCIES} sphinxbase)
      INCLUDE_DIRECTORIES(${SPHINXBASE_SOURCE_DIR}/include/win32)
      INCLUDE_DIRECTORIES(${SPHINXBASE_SOURCE_DIR}/include)
  endif ()
  SET(LIBS ${LIBS} ${SPHINXBASE_LIBRARIES})
  </code></pre>
  
  <p><code>${CMAKE_BINARY_DIR}</code> is set correctly to <code>C:/Users/syb0rg/Dropbox/Development/Khronos/Khronos/build</code>, and here is what part of the folder looks like:</p>
  
  <p><a href="https://i.stack.imgur.com/somJU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/somJU.png" alt="enter image description here"></a></p>
  
  <p>As you can see, I have a Makefile present at the specified location.  What's going on here?  Why can't CMake/MinGW find it?</p>
  
  <hr>
  
  <p><strong>Supplemental build information, <a href="https://github.com/syb0rg/Khronos" rel="nofollow noreferrer">link to full project</a></strong></p>
  
  <p>My program's configure log:</p>
  
  <pre><code>-- The C compiler identification is GNU 6.2.0
  -- The CXX compiler identification is GNU 6.2.0
  -- Check for working C compiler: C:/Program Files/mingw-w64/x86_64-6.2.0-posix-seh-rt_v5-rev1/mingw64/bin/gcc.exe
  -- Check for working C compiler: C:/Program Files/mingw-w64/x86_64-6.2.0-posix-seh-rt_v5-rev1/mingw64/bin/gcc.exe -- works
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Check for working CXX compiler: C:/Program Files/mingw-w64/x86_64-6.2.0-posix-seh-rt_v5-rev1/mingw64/bin/g++.exe
  -- Check for working CXX compiler: C:/Program Files/mingw-w64/x86_64-6.2.0-posix-seh-rt_v5-rev1/mingw64/bin/g++.exe -- works
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- No build type selected, default to Release
  -- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE) 
  -- Could NOT find sphinxbase (missing:  SPHINXBASE_LIBRARY SPHINXBASE_INCLUDE_DIR) 
  -- Could NOT find pocketsphinx (missing:  POCKETSPHINX_LIBRARY POCKETSPHINX_INCLUDE_DIR) 
  -- Could NOT find LibSndFile (missing:  LIBSNDFILE_LIBRARY LIBSNDFILE_INCLUDE_DIR) 
  -- Could NOT find tritium (missing:  TRITIUM_LIBRARY TRITIUM_INCLUDE_DIR) 
  -- Any missing dependencies will be downloaded upon running "make"
  -- Configuring done
  -- Generating done
  -- Build files have been written to: C:/Users/syb0rg/Dropbox/Development/Khronos/Khronos/build
  </code></pre>
  
  <p>And build log:</p>
  
  <pre><code>[  2%] Performing build step for 'PortAudio'
  -- PortAudio build command succeeded.  See also C:/Users/syb0rg/Dropbox/Development/Khronos/Khronos/build/build-data/src/PortAudio-stamp/PortAudio-build-*.log
  [  4%] No install step for 'PortAudio'
  [  6%] Completed 'PortAudio'
  [ 17%] Built target PortAudio
  Scanning dependencies of target sphinxbase
  [ 20%] Creating directories for 'sphinxbase'
  [ 22%] Performing download step (git clone) for 'sphinxbase'
  -- sphinxbase download command succeeded.  See also C:/Users/syb0rg/Dropbox/Development/Khronos/Khronos/build/build-data/src/sphinxbase-stamp/sphinxbase-download-*.log
  [ 24%] No patch step for 'sphinxbase'
  [ 26%] No update step for 'sphinxbase'
  [ 28%] No configure step for 'sphinxbase'
  [ 31%] Performing build step for 'sphinxbase'
  CMakeFiles\sphinxbase.dir\build.make:110: recipe for target 'build-data/src/sphinxbase-stamp/sphinxbase-build' failed
  CMakeFiles\Makefile2:103: recipe for target 'CMakeFiles/sphinxbase.dir/all' failed
  Makefile:82: recipe for target 'all' failed
  </code></pre>