Yes, with:<div><br></div><div>  <a href="http://cmake.org/cmake/help/v2.8.8/cmake.html#prop_tgt:LOCATION">http://cmake.org/cmake/help/v2.8.8/cmake.html#prop_tgt:LOCATION</a></div><div>    or<br>  <a href="http://cmake.org/cmake/help/v2.8.8/cmake.html#prop_tgt:LOCATION_CONFIG">http://cmake.org/cmake/help/v2.8.8/cmake.html#prop_tgt:LOCATION_CONFIG</a> for per-config values</div>
<div><br></div><div>and:</div><div><br></div><div>  <a href="http://cmake.org/cmake/help/v2.8.8/cmake.html#command:get_filename_component">http://cmake.org/cmake/help/v2.8.8/cmake.html#command:get_filename_component</a></div>
<div><br></div><div><br></div><div>HTH,</div><div>David</div><div><br></div><div><br><div class="gmail_quote">On Wed, Jun 20, 2012 at 2:33 PM, Robert Dailey <span dir="ltr">&lt;<a href="mailto:rcdailey.lists@gmail.com" target="_blank">rcdailey.lists@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">If I were to try to do this *after* calling add_executable() or add_library(), would it be easier to obtain?<div class="HOEnZb">
<div class="h5"><br><br><div class="gmail_quote">On Wed, Jun 20, 2012 at 12:54 PM, Thompson, K T <span dir="ltr">&lt;<a href="mailto:kgt@lanl.gov" target="_blank">kgt@lanl.gov</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d">Robert,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d">I’m not sure this is exactly what you are looking for, but you may be able to use “generator expressions.”  See the documentation for add_custom_command for more
 details, but basically you can use the expression $&lt;TARGET_FILE:foo&gt; to retrieve the executable name generated by target ‘foo’.  I think this only works after you use add_executable( foo ${src} ).<u></u><u></u></span></p>


<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d">-kt<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> <a href="mailto:cmake-bounces@cmake.org" target="_blank">cmake-bounces@cmake.org</a> [mailto:<a href="mailto:cmake-bounces@cmake.org" target="_blank">cmake-bounces@cmake.org</a>]
<b>On Behalf Of </b>Robert Dailey<br>
<b>Sent:</b> Wednesday, June 20, 2012 11:41 AM<br>
<b>To:</b> CMake ML<br>
<b>Subject:</b> Re: [CMake] How to get target binary name?<u></u><u></u></span></p>
</div>
</div><div><div>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Another note: This has to work the same for both release and debug, and for both visual studio and makefile generators.<u></u><u></u></p>
<div>
<p class="MsoNormal">On Wed, Jun 20, 2012 at 12:40 PM, Robert Dailey &lt;<a href="mailto:rcdailey.lists@gmail.com" target="_blank">rcdailey.lists@gmail.com</a>&gt; wrote:<u></u><u></u></p>
<p class="MsoNormal">I&#39;m looking for the quickest and most natural way to get the final binary name of a target, ideally before add_executable() or add_library() is called (not sure if this is possible).<u></u><u></u></p>


<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">For example, if my executable target&#39;s output is fubar.exe, I want to get &quot;fubar.exe&quot; in a variable.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Any examples? Thanks.<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div></div></div>
</div>
</div>

</blockquote></div><br>
</div></div><br>--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br></div>