If your goal is to link an executable to MainLib.lib, and MainLib.lib only, then please add all the sources directly to the add_library(MainLib STATIC ...) call.<div><br></div><div>That is the easiest, most logical way to accomplish that task.</div>
<div><br></div><div>If it's something else, then elaborate with more details. Perhaps somebody else will chime in if they have another good suggestion...<br><br></div><div>CMake does not directly support "convenience libs" -- search the mailing list archives. This subject has had much discussion over the years.</div>
<div><br></div><div>Add all the sources to one library if that's what you want.....</div><div><br></div><div><br></div><div>HTH,</div><div>David</div><div><br></div><div><br><div class="gmail_quote">On Wed, Sep 22, 2010 at 12:19 PM, Andrea Galeazzi <span dir="ltr"><<a href="mailto:galeazzi@korg.it">galeazzi@korg.it</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
On 22. Sep, 2010, at 12:48 , Andrea Galeazzi wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br></div>