Hello!
Jason Heeris wrote > The only problem I encountered was that the final shared library complains > about having "NO SOURCES given to target: module3_dll". I can add > "module3.c" as a source, even though technically the static lib should > already contain everything from there. I'm not sure why that's an issue > though. The reason is that SHARED_LIBRARY targets must have sources to be built. The fact that everything is already in the static library does not matter. In this case, it may worth using OBJECT_LIBRARY targets, but in a different way: add an object library and provide it as sources for your target <https://cmake.org/cmake/help/v3.5/command/add_library.html#object-libraries> . However, I did not succeed when I tried it on my own project (most likely due to my own incompetence). Jason Heeris wrote > On Thu, 28 Jun 2018 at 04:16, Innokentiy Alaytsev < > alaitsev@ > > > wrote: > >> Also, I have an important note about the structure of the project: It may > be better to have all the dependencies defined before they are used, i.e. > you should not be able to use the target_link_libraries() with an > undefined > target as a linked library. > > I have no idea how I'd achieve this though, with so many subdirectories. I > think CMake is perfectly happy to resolve these links at generate time > rather than as the configuration is parsed though? You may be right about CMake being happy to resolve everything by itself. As I wrote "It may be better", so I may as well be plain wrong. -- Sent from: http://cmake.3232098.n2.nabble.com/ -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake