<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.6.6">
</HEAD>
<BODY>
In my Mac OSX builds I want to run dsymutil to create .dSYM debug contents.  However, this is very slow so I don't want to do it during normal builds (where it's not needed because I have all the object files), I only want it to be done during the install step.<BR>
<BR>
I can create an add_custom_command() to run dsymutil easily enough, something like:<BR>
<BR>
<PRE>
  function(stagedebug target dir)
      if(APPLE)
          set(destfile "${dir}/${target}.dSYM/Contents/Info.plist")
          add_custom_command(OUTPUT "$destfile"
              COMMAND dsymutil "${dir}/${target}"
              MAIN_DEPENDENCY ${target}
              COMMENT "Staging dSYM for ${target} to ${dir}"
              VERBATIM)

          # Now what?
      endif
  endfunction()
</PRE>
<BR>
but I have no idea how to hook this into the install step.  I don't see anything in the install() command that lets me specify a target to be run, it just seems to be able to copy files.<BR>
<BR>
What am I missing?<BR>
<BR>
Thanks!
</BODY>
</HTML>