Tyler, <br><br>Please find my comments below.<br><br><div class="gmail_quote">2009/5/29 Tyler Roscoe <span dir="ltr"><<a href="mailto:tyler@cryptio.net">tyler@cryptio.net</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Thu, May 28, 2009 at 10:03:11PM +0300, Dmytro Ovdiienko wrote:<br>
> That was just a sample. CMake can build it correctly, if you specify full<br>
> path to the include directlry.<br>
><br>
> If you root CMakeLists.txt declares ROOT_PRJ you can write following in the<br>
> A project.<br>
><br>
> INCLUDE_DIRECTORIES(<br>
> ${ROOT_PRJ_SOURCE_DIR}/B<br>
> )<br>
><br>
> And following in the B project<br>
><br>
> INCLUDE_DIRECTORIES(<br>
> ${ROOT_PRJ_SOURCE_DIR}/A<br>
> )<br>
<br>
</div>This is how I would do it. Either this, or just define A_SOURCE_DIR and<br>
B_SOURCE_DIR in your top-level CMakeLists.<br>
<div class="im"></div></blockquote><div><br>I prefer encapsulation of all library related information into the library. Only library know where it is located, where are public headers are located, where lib file is located. The way you proposed violates this encapsulation.<br>
<br>Do you use .NET? Do you know how it is easy to use assemblies. There
are no lib files, no headers. You just provide linker with one DLL
file. It contains all needed information to build project.<br>
<br>
I want to use libraries like assembly. Target can store all information about PUBLIC_HEADERS and lib files. You should just say "Library A depends on library B". CMake should extract information about header files and lib files from A and place it to B. <br>
<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im"><br>
> A and B are static libraries. The order static libraries building has no<br>
> mater.<br>
<br>
</div>Not true. Typically I interpret "dependencies" in this context to<br>
describe a situation where source files in B rely on symbols in libA.<br>
Therefore, libA must be available so that we can compile (and link)<br>
libB. In this situation, libA obviously must be built before libB.<br>
<div class="im"></div></blockquote><div><br>Yeah, source files of the B depends on symbols from libA. But linker do not need to resolve all dependencies while it creates lib files. Sure, we are not talking about cases when libA are linked directly to libB. <br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im"><br>
> It is defined if B folder is processed before A folder. But then<br>
> A_SOURCE_DIR is not defined in the B project (circular dependency)<br>
<br>
</div>Ok, now I see what you mean. As noted above, I would move the dependency<br>
up to the top level to prevent this loop.<br>
<br>
I still don't understand how you would expect CMake to handle this<br>
situation.<br>
<div class="im"></div></blockquote><div><br>I expected CMake to replace B_SOURCE_DIR with <root>/B and A_SOURCE_DIR with <root>/A. Thats all.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im"><br>
> But... why does TARGET_LINK_LIBRARIES work correctly? You can pass not<br>
> loaded-yet project name to TARGET_LINK_LIBRARIES.<br>
<br>
</div>I think my favorite pop superstar-nee-software developer Mike Jackson<br>
already addressed this point (just because libs and targets happen to<br>
have the same name doesn't mean that they are the same concept).<br>
<font color="#888888"><br>
tyler<br>
</font></blockquote></div><br><br>Best regards<br><br>Dima<br>