title: cmake custom command to copy and rename
body: <p>I have an existing cmake file that generates a .so library. I want to modify it so that it will then make a copy of the .so named something else. This is roughly what I have:</p>
  
  <pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)
  PROJECT(test1)
  
  SET(TEST_SOURCES f1.c)
  ADD_LIBRARY(test SHARED ${TEST_SOURCES})
  ADD_CUSTOM_COMMAND(
      OUTPUT custom1
      COMMAND cp libtest.so custom1
      DEPENDS libtest.so)
  </code></pre>
  
  <p>I realise there are better ways than hardcoding the library name, I'm just doing this while I try and figure out how to make it work at all.
  What's the thing I'm missing that will cause my copy/rename custom command to run?
  Note: this is not an install-time thing.
  Thanks</p>