<div class="gmail_quote">On Thu, Feb 12, 2009 at 11:43 AM, Luigi Calori <span dir="ltr">&lt;<a href="mailto:l.calori@cineca.it">l.calori@cineca.it</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Philip Lowman ha scritto:<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="Ih2E3d">&nbsp;&nbsp; add_library(baz STATIC IMPORTED)<br>
 &nbsp; &nbsp;set_target_properties(baz PROPERTIES<br>
 &nbsp; &nbsp; &nbsp; IMPORTED_LOCATION_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/libbaz.a<br>
 &nbsp; &nbsp; &nbsp; IMPORTED_LOCATION_DEBUG &nbsp; ${CMAKE_CURRENT_SOURCE_DIR}/libbazd.a)<br>
<br>
 &nbsp; &nbsp;add_library(bar STATIC IMPORTED)<br>
 &nbsp; &nbsp;set_target_properties(bar PROPERTIES<br>
 &nbsp; &nbsp; &nbsp; IMPORTED_LOCATION_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/libbar.a<br>
 &nbsp; &nbsp; &nbsp; IMPORTED_LOCATION_DEBUG &nbsp; ${CMAKE_CURRENT_SOURCE_DIR}/libbard.a<br>
 &nbsp; &nbsp; &nbsp; IMPORTED_LINK_INTERFACE_LIBRARIES baz) # &lt;-- dependency is here<br>
<br>
</div></blockquote>
I&#39; ma bit confused, just to make clear: the proposed import method &nbsp;are used in the &nbsp;final projects that USES the libraries.<br>
by install(EXPORT) the needed code is hidden in a config--baz--cmake file that is evaluated inby the final project tha so does not have to rely on FindBAZ script.<br>
But effectively this is just a way to hide the fact that &nbsp;the final project &nbsp;links to both libbaz and libbar<br>
<br>
The specification of dependency lib as a STATIC_LIBRARY_FLAGS produce a bigger library tha has both baz and bar, and can be used straight, at least under VS7.1<br>
<br>
I appreciate the IMPORT and EXPORT stuff and will try to use that (could we use that also for the whole OpenSceneGraph itself ? what do you think Philip?)<br>
Nevertheless the STATIC_LIBRARY_FLAGS seems much simpler</blockquote><div><br>Not to take things too off-topic, but I actually like the idea of building libjpeg, libtiff, libpng, and even libfreetype within the OSG itself just like VTK does, but building them only on Windows platforms (especially since Kitware has already &quot;CMakeified&quot; them).&nbsp; If Robert has concerns about tarball size these could always be located in a separate tarball for releases that Windows users would have to download separately.&nbsp; For Linux, though, I think it would be a mistake to build these libraries since 99% of distributions have them anyways and they are well maintained with bugfixes and security patches.<br>
<br>This would get you what you want on WIN32 anyways which is being able to use the libraries statically while at the same time it would reduce the burden on maintaining the 3rdPartyDeps solution for OSG for every possible way of compiling with Visual Studio 7.1, 8.0, or 9.0 (and by the way, would you like /MT or /MD with that?).<br>
<br>In regards to your question though,<br><br>IMPORT/EXPORT looks very interesting for CMake projects, but I really haven&#39;t used it in this context yet or for importing external dependencies (other than &quot;bar&quot; and &quot;baz&quot;) to have an opinion on the matter.&nbsp; :) &nbsp; I think Bill has some good points about portability.&nbsp; I didn&#39;t completely understand what you needed STATIC_LIBRARY_FLAGS for.&nbsp; In fact part of me still doesn&#39;t as I&#39;ve never needed to clump static libraries together for convenience in any of the projects I work on.<br>
</div></div><br>-- <br>Philip Lowman<br>