title: CMake Error (configure_file): configure_file error configuring file
body: <p>I am working on a project on <strong>c++</strong> and need to execute a <strong>CMakeLists.txt</strong> file to run it. I installed <em>cmake</em>, <em>doxygen</em>, <em>cmake-curses-gui</em> and <em>make</em> using <code>sudo</code>. Then I tried running the file.</p>
  
  <p>The following is a part of the cmake code  -</p>
  
  <pre><code>if (BUILD_DOC)
     find_package(Doxygen)
     configure_file(${PROJECT_SOURCE_DIR}/doc/Doxyfile.in
     ${PROJECT_SOURCE_DIR}/doc/Doxyfile @ONLY)
     add_custom_target(${PROJECT_NAME}_doc ALL ${DOXYGEN_EXECUTABLE}
     ${PROJECT_SOURCE_DIR}/doc/Doxyfile)
  endif ()
  </code></pre>
  
  <p>Here, it gave me an error message saying that </p>
  
  <blockquote>
    <p>CMake Error at CMakeLists.txt:77 (configure_file):    configure_file
    Problem configuring file</p>
  </blockquote>
  
  <p>Just so that you know, line 77 is <code>configure_file(${PROJECT_SOURCE_DIR}/doc/Doxyfile.in</code> . </p>
  
  <p>If I add <code>AND DOXYGEN_FOUND</code> to the <code>if</code> condition, it doesn't execute anything at all which means that it couldn't find a <em>doxygen executable</em>. But as I already told, I already installed <em>doxygen</em>. </p>
  
  <p>I am new to cmake. So, could anyone please help me with this</p>
  
  <p>Edit:</p>
  
  <p>The OS I am using is Ubuntu 16.04</p>
  
  <p>After I put <code>if(DOXYGEN_FOUND)</code> after the command <code>find_package(doxygen)</code> it executed, but I got the same <em>cmake error</em> in <strong>line 78</strong> instead of <strong>line 77</strong></p>
  
  <p>Also, now since I got enough information from the comments, I just realized that my problem is more towards finding where the Doxyfile.in file lies than configuring the file. Could anyonee help me with it?</p>