title: Jenkins and CMake: permission errors
body: <p>I installed Jenkins, I'm new to it. Made a user, installed the CMake plugin. I'm trying to compile a simple project just to get started but I cannot even do that.</p>
  
  <p>After complaining of not being able to open some files (like build/CMakeFiles/CMakeOutput.log), at the end of the output it says:</p>
  
  <pre><code>-- Configuring incomplete, errors occurred!
  CMake Error: Cannot open file for write: /home/username/development/csa/build/CMakeCache.txt.tmp
  CMake Error: : System Error: Permission denied
  CMake Error: Unable to open cache file for save. /home/username/development/csa/build/CMakeCache.txt
  CMake Error: : System Error: Permission denied
  Build step 'CMake Build' marked build as failure
  Finished: FAILURE
  </code></pre>
  
  <p>To me this is clearly a permissions issue. The build directory is empty, it has not done anything. I created a user, started jenkins and either of the following had no effect on the output:</p>
  
  <pre><code>sudo /etc/init.d/jenkins start --user jenkins
  sudo /etc/init.d/jenkins start --user username
  sudo /etc/init.d/jenkins start
  </code></pre>
  
  <p>I'm not even trying to compile the code, just trying to build the cmake files... my configuration is like this: (as simple as possible)</p>
  
  <p><a href="https://i.stack.imgur.com/ftfoI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ftfoI.png" alt="enter image description here"></a></p>
  
  <p>I did add a working directory which is in my home folder so I do have permissions for it. </p>
  
  <p>EDIT: I changed the ownership of the build folder to jenkins, created a user group called jenkinsusers, added myself and jenkins to the group, and gave the group read/write permissions. It appears to work now. But I'm not sure this is the standard way to do this... </p>