title: How to call a CMake function from add_custom_target/command?
body: <p>Is it possible to call a CMake function out of an <code>add_custom_target</code> or <code>add_custom_command</code>?</p>
  
  <p>I know I could move the CMake function to a Python (or whatever) script and call it from <code>add_custom_target</code>/<code>command</code> but I would like to avoid having tons of script next to the existing CMake infra.</p>
  
  <p>What I want to achieve is to use CPack for generating a zip package of binary artifacts and publish them in an artifact repository. For the publishing part I have already the CMake function created but now I need to combine the packaging and publishing together.</p>
  
  <p>Thanks for any help/hints in advance.</p>