title: How add execution permissions to file generated by CMake?
body: <p>I have a file, <em>wrapper.sh.in</em>, that has something like the following:</p>
  
  <pre><code>#!/bin/bash
  DEPENDENCY_VERSION=@dependency_VERSION@
  /location/of/installed/dependency/${DEPENDENCY_VERSION}/some_script.sh "$@"
  </code></pre>
  
  <p>This <em>wrapper.sh.in</em> script has the usual file permissions for a regular non-executable files (0644), but I need the file generated by CMake to have execution permissions, since it is a script, and therefore meant to be run.</p>
  
  <p><br />
  Here's what I am currently doing in my CMakeLists.txt in order to generate my wrapper script:</p>
  
  <pre><code>configure_file(
      ${CMAKE_CURRENT_SOURCE_DIR}/wrapper.sh.in
      ${CMAKE_CURRENT_SOURCE_DIR}/wrapper.sh
      @ONLY
      )
  </code></pre>
  
  <p><br />
  Here's what I've tried for changing the permissions for the generated <em>wrapper.sh</em> script.</p>
  
  <p>Attempt #1 (FAIL):</p>
  
  <pre><code>file(
      COPY ${CMAKE_CURRENT_SOURCE_DIR}/wrapper.sh
      DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}
      FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
      )
  </code></pre>
  
  <p>Attempt #2 (FAIL):</p>
  
  <pre><code>install(
      FILES ${CMAKE_CURRENT_SOURCE_DIR}/wrapper.sh
      DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}
      PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
      COMPONENT runtime
      )
  </code></pre>
  
  <p><br />
  What would be the correct way to change the file permissions of the generated <em>wrapper.sh</em> script to those of a normal script (0755)?</p>