<br><br><div class="gmail_quote">On Wed, Sep 22, 2010 at 11:19 AM, Andrea Galeazzi <span dir="ltr"><<a href="mailto:galeazzi@korg.it">galeazzi@korg.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Citando Michael Wild <<a href="mailto:themiwi@gmail.com" target="_blank">themiwi@gmail.com</a>>:<div><div></div><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
On 22. Sep, 2010, at 12:48 , Andrea Galeazzi wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi everybody,<br>
I've got a static lib project in vc6 as follow<br>
lib1<br>
lib2<br>
......<br>
libN<br>
MainLib<br>
<br>
The MainLib doesn't actually have any source but it depends form all the other projects (lib1,.....,libN) so it builds a static lib which contains all the ones.<br>
Now my problems is how to write a CMakeLists in order to reproduce both the same build and the same structure of solution in VS 2010 as the original one.<br>
Does anybody have any ideas?<br>
Cheers<br>
</blockquote>
<br>
Do you ever *need* lib1..libN except for assembling MainLib? If not, just drop them, they're useless.<br>
<br>
Michael<br>
<br>
--<br>
There is always a well-known solution to every human problem -- neat, plausible, and wrong.<br>
H. L. Mencken<br>
<br>
<br>
</blockquote>
<br></div></div>
That's true but how can I then generate a vcprj for each lib? Now my filesystem is:<br>
MainLib<br>
CMakeLists.txt<br>
+lib1<br>
CMakeLists.txt<br>
source1_1<br>
source1_2<br>
........<br>
+lib2<br>
CMakeLists.txt<br>
source2_1<br>
source2_2<br>
........<br>
..........<br>
+libN<br>
CMakeLists.txt<br>
sourceN_1<br>
sourceN_2<br>
........<br>
<br>
CMakeLists.txt in MainLib has:<br>
add_library(MainLib STATIC )<br>
add_subdirectory(lib1)<br>
...........<br>
target_link_libraries (MainLib lib1)<br>
<br>
it produces a right vs solution but it dosen't produce the MainLib.lib<div><div></div><div class="h5"><br><br></div></div></blockquote><div><br>If you want to do the separate vcproj files for each separate library, you probably need to make mainlib shared and add an empty dummy.cxx file in your add_library call. (A static library is pretty much just a bunch of object files glued together, so you don't really "link" a static library, in my understanding, you just need to track those transitive link dependencies for whatever ends up using your library).<br>
<br>The alternate, and preferred, technique would be to build a single library for mainlib, and separate the sources for the "sub-components" using source_group instead of projects. There shouldn't really be a difference in link time or build time, and since you probably should be using the solution file rather the individual vcproj files to launch your environment, there's really be very little effective difference.<br>
<br>Ryan<br></div></div>-- <br>Ryan Pavlik<br>HCI Graduate Student<br>Virtual Reality Applications Center<br>Iowa State University<br><br><a href="mailto:rpavlik@iastate.edu">rpavlik@iastate.edu</a><br><a href="http://academic.cleardefinition.com">http://academic.cleardefinition.com</a><br>
Internal VRAC/HCI Site: <a href="http://tinyurl.com/rpavlik">http://tinyurl.com/rpavlik</a><br>