Hi André,<br><br><div class="gmail_quote">2012/5/2 André Caron <span dir="ltr"><<a href="mailto:andre.l.caron@gmail.com" target="_blank">andre.l.caron@gmail.com</a>></span> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><div>I've come up with a simple workflow where each library project exports a "library-config.cmake" file and any project that includes it defines the "library_DIR" variable to the folder containing this "library-config.cmake" file so that it can be resolved from anywhere in the CMake scripts using only "find_package()". This way, when the library can either set the "library_DIR" variable or inherit it from the parent project. This solves the problem of using either its own Git submodule or a parent project's Git submodule, ensuring you build the library only once for the entire project and that all sub-projects use the same version.</div>
</div></blockquote><div><br></div><div>I am testing with a similar solution, having an example is great! I like the solution on how to build the dependencies (using the add_subdirectory in the config.cmake). I might need to reorder my project a little bit for this, but definitely looks useful! </div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div>I'm slowly converting all my projects to CMake using this pattern. You can find some of those on my GitHub profile[2]. One example is cfcgi[3]. Note that I'm learning a lot along the way and I don't guarantee that all of this conforms to CMake best practices. I'm only referring to this for the project structure and CMake concept to clarify my explanation with an example. That being said, if anyone has comments about the CMake scripts in there, your input is welcome :-)</div>
</div></blockquote><div><br></div><div>I'll see if I can make an example for my usecase. If I have some comments/additions I will post them here. </div></div><br clear="all"><div><br></div>-- <br>Met vriendelijke groet,<br>
<br>Alexander Broekhuis<br>