Thank you very much fo all your answers.. It is much clearer now... I was 
actually trying to use add_subdirectory to manage my dependencies but it is 
obviously not the best way to do it. 
Well the question is still here though, how can I "build B standalone" and 
build "B within A" as a dependency (well check if B is up to date before 
building A ?)

Thanks again

Pierre-Julien
________________________________________
De : [email protected] [[email protected]] de la part de David Cole 
[[email protected]]
Date d'envoi : samedi 12 septembre 2009 12:51
À : Michael Wild
Cc : cmake; Bill Hoffman
Objet : Re: [CMake] add_subdirectory and build directory

On Sat, Sep 12, 2009 at 2:45 AM, Michael Wild 
<[email protected]<mailto:[email protected]>> wrote

True, but then you wouldn't point it at a binary directory. AFAIK, if you point 
project A at an out-of-source source, say project B, that project B will be 
built completely within the binary tree of A.


The second argument to add_subdirectory allows you to put the binary tree of 
"project B's build tree within project A" anywhere you want...

Of course, it should not be the same as a build tree of "standalone project 
B".... Because that's a different build.

Perhaps that's where the confusion is in this case?

Pierre-Julien, is that what you are expecting? When you use add_subdirectory, 
you should typically leave off the 2nd argument unless you just want to 
organize things differently than CMake does by default. But if you do use it, 
make sure that the directory you give it is unique across all other projects 
that you build. "B built within A" is different than "standalone B" -- do not 
try to mix and match builds with add_subdirectory -- use it as a convenient way 
of building a project as a component of another project...

Does that help?

Hope so,
David

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to