<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi,<br>
    <br>
    More generally speaking, I'm looking a way to query the existing
    configuration in terms of<br>
    - what are the libraries, executables, tests, etc... <br>
    - properties, compiler flags<br>
    declared through out various CMakeLists.txt<br>
    and WHERE they are declared ie in which directory (package)<br>
    <br>
    This is also related with the former question: why to separate
    config phase from build phase?<br>
    <br>
    In a very large project, made of a large number of packages in a
    wide DAG , developped by a large teas of developers, it's very
    desirable to QUERY such config without having to find/grep through
    out the zillions of CMakeLists.txt files.<br>
    <br>
    It should trivial for CMake developers to add a kind of Database of
    all items to be constructed (basically all targets + how they are
    setup)<br>
    <br>
    goals:<br>
    <br>
    - debugging purposes<br>
    - understanding why/where/how a target exists<br>
    - understanding the relationships/dependencies between targets (even
    for those are not under your control)<br>
    - figure out the directory structure of the software base<br>
    <br>
    I have managed to replace most of the add_xxx functions (plus some
    others) so as to offer the query feature to CMake but would it be
    offered by native CMake, this would be safer and efficient.<br>
    <br>
    Comments?<br>
    <br>
    Regards<br>
    Christian<br>
    <br>
    <br>
    Le 20/06/2012 20:48, David Cole a &eacute;crit&nbsp;:
    <blockquote
cite="mid:CAAdwe9WP6b388E26NVkAD0=z32hwXyG2cUsdfwN+qFhTp8ADmw@mail.gmail.com"
      type="cite">Yes, with:
      <div><br>
      </div>
      <div>&nbsp; <a moz-do-not-send="true"
          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>&nbsp; &nbsp; or<br>
        &nbsp; <a moz-do-not-send="true"
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>&nbsp; <a moz-do-not-send="true"
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 moz-do-not-send="true"
              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
                      moz-do-not-send="true" 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 link="blue" vlink="purple" lang="EN-US">
                      <div>
                        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d">Robert,</span></p>
                        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d">&nbsp;</span></p>
                        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d">I&#8217;m
                            not sure this is exactly what you are
                            looking for, but you may be able to use
                            &#8220;generator expressions.&#8221;&nbsp; See the
                            documentation for add_custom_command for
                            more details, but basically you can use the
                            expression $&lt;TARGET_<a class="moz-txt-link-freetext" href="FILE:foo">FILE:foo</a>&gt; to
                            retrieve the executable name generated by
                            target &#8216;foo&#8217;.&nbsp; I think this only works after
                            you use add_executable( foo ${src} ).</span></p>
                        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d">&nbsp;</span></p>
                        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d">-kt</span></p>
                        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d">&nbsp;</span></p>
                        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d">&nbsp;</span></p>
                        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1f497d">&nbsp;</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 moz-do-not-send="true"
                                    href="mailto:cmake-bounces@cmake.org"
                                    target="_blank">cmake-bounces@cmake.org</a>
                                  [mailto:<a moz-do-not-send="true"
                                    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?</span></p>
                            </div>
                          </div>
                          <div>
                            <div>
                              <p class="MsoNormal">&nbsp;</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.</p>
                              <div>
                                <p class="MsoNormal">On Wed, Jun 20,
                                  2012 at 12:40 PM, Robert Dailey &lt;<a
                                    moz-do-not-send="true"
                                    href="mailto:rcdailey.lists@gmail.com"
                                    target="_blank">rcdailey.lists@gmail.com</a>&gt;
                                  wrote:</p>
                                <p class="MsoNormal">I'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).</p>
                                <div>
                                  <p class="MsoNormal">&nbsp;</p>
                                </div>
                                <div>
                                  <p class="MsoNormal">For example, if
                                    my executable target's output is
                                    fubar.exe, I want to get "fubar.exe"
                                    in a variable.</p>
                                </div>
                                <div>
                                  <p class="MsoNormal">&nbsp;</p>
                                </div>
                                <div>
                                  <p class="MsoNormal">Any examples?
                                    Thanks.</p>
                                </div>
                              </div>
                              <p class="MsoNormal">&nbsp;</p>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </blockquote>
                </div>
                <br>
              </div>
            </div>
            <br>
            --<br>
            <br>
            Powered by <a moz-do-not-send="true"
              href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
            <br>
            Visit other Kitware open-source projects at <a
              moz-do-not-send="true"
              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
              moz-do-not-send="true"
              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 moz-do-not-send="true"
              href="http://www.cmake.org/mailman/listinfo/cmake"
              target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">--

Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>

Visit other Kitware open-source projects at <a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>

Please keep messages on-topic and check the CMake FAQ at: <a class="moz-txt-link-freetext" href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a>

Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a></pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
--------------------------------------------
| Christian Arnault                        |
| LAL Bat 200 pi&egrave;ce 03a                    |
| 91405 Orsay CEDEX                        |
| phone   : (33) 1 64 46 84 24             |
| gsm     : (33) 6 77 27 62 30             |
| fax     : (33) 1 69 07 94 04             |
| e-mail  : <a class="moz-txt-link-abbreviated" href="mailto:christian.arnault@lal.in2p3.fr">christian.arnault@lal.in2p3.fr</a> |
--------------------------------------------
</pre>
  </body>
</html>