<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hello Olaf,<br>
      <br>
      The problem is that find_package is done at configuration time of
      the project, and building the external project is done during
      buildtime (after configuration time that is). This is the reason
      why most projects that want to use third party / external software
      create a so called superproject. A super project puts your project
      in a externalproject as well en thus runs cmake twice: once for
      all the external projects, and once when building your project.
      Take a look at the structure of openchemistry (git://github.com/OpenChemistry/openchemistry.git)
      which demonstrates this principle.<br>
      <br>
      HTH,<br>
      Micha<br>
      <br>
      On 10/18/2013 01:34 PM, Olaf Ryder wrote:<br>
    </div>
    <blockquote
cite="mid:CAOB2_pCGccxN7saBeZ5YpeFPxuRX-dj5SH5MR5QhJMbBb-=tqg@mail.gmail.com"
      type="cite">
      <div dir="ltr">Here's the problem I'm trying to solve:
        <div><br>
        </div>
        <div style="">* External Project A has no dependencies and
          generates LibraryA</div>
        <div style="">* External Project B is dependent on LibraryA</div>
        <div style="">
          <br>
        </div>
        <div style="">Root CMakeLists.txt:</div>
        <div style="">add_subdirectory(external_project_a)</div>
        <div style="">add_subdirectory(external_project_b)</div>
        <div style=""><br>
        </div>
        <div style="">External Project A CMakeLists.txt:</div>
        <div style="">ExternalProject_Add(projectA ...)</div>
        <div style=""><br>
        </div>
        <div style="">External Project B CMakeLists.txt:</div>
        <div style="">find_package(LibraryA)</div>
        <div style="">ExternalProject_Add(projectB ...)</div>
        <div style="">
          <br>
        </div>
        <div style=""><br>
        </div>
        <div style="">When I configure CMake, it finds an old, locally
          installed version of LibraryA. When cross-compiling, I want
          External Project B's find_package(LibraryA) to find the newly
          cross-compiled LibraryA.&nbsp;</div>
        <div style=""><br>
        </div>
        <div style="">It feels like I need to somehow "run find_package
          again" at that point so it finds the right one. Right now I
          can manually make it work by building/installing External
          Project A then manually clearing my build folder and
          re-running CMake.</div>
        <div style=""><br>
        </div>
        <div style="">How do I get External Project B to see the new
          cross-compiled LibraryA?</div>
        <div style=""><br>
        </div>
        <div style="">Thanks</div>
        <div style=""><br>
        </div>
      </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>

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>

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: <a class="moz-txt-link-freetext" href="http://cmake.org/cmake/help/support.html">http://cmake.org/cmake/help/support.html</a>
CMake Consulting: <a class="moz-txt-link-freetext" href="http://cmake.org/cmake/help/consulting.html">http://cmake.org/cmake/help/consulting.html</a>
CMake Training Courses: <a class="moz-txt-link-freetext" href="http://cmake.org/cmake/help/training.html">http://cmake.org/cmake/help/training.html</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>

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>
  </body>
</html>