[CMake] ExternalProject_Add + find_package

Alvaro Denis denisacostaq at gmail.com
Mon Mar 9 09:05:03 EDT 2015


Hello,
I am using cmake(I am a novice) for a big project, this contain multiple
independent projects(no use add_subdirectory), so take an example:
Project A depend of B, when  I run cmake for A this check for B with
find_package(), if this fail the user is notified and need install
B, I think that manage this automatically is desirable, I propose
ExternalProject_Add, so this download, configure, build and install the
dependence automatically but my problem is:
When I execute cmake for A this say that B not found, so find this
and install, but then the "first" make fail because the first time the
"imported targets"
are empty, so I need rerun cmake, this time find_package()
fill the "imported targets" and build ok.
How I can avoid this(execute cmake ; make ; cmake ; make).
Thanks a lot.

-- 

   [image: --]

ALvaro Denis Acosta
[image: http://]about.me/denisacostaq
   <http://about.me/denisacostaq?promo=email_sig>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150309/dbd4b770/attachment.html>


More information about the CMake mailing list