[CMake] Linker error with sub project's static libs

Olaf Peter ope-devel at gmx.de
Thu Aug 21 14:19:29 EDT 2014


Hello Marcel,
> Olaf,
>
> Unless your code snippets are incomplete, I'm missing the following
> statement in ./source/eea/ui/CMakeLists.txt
>
>      target_link_libraries(eea_ui_lib
>          eea_ui_schematic_lib)
>
> I'm not sure this is causing the link error, but it's worth a try.
thank you a lot, this solves the linker problem - I have to add these 
twice, reference to the other lib each time.
>
> Furthermore, I think the order of add_subdirectory(), add_library(), and
> target_link_libraries() is important. You might want to check those as well.
The order matches of course, but I haven't never such linker problems. 
The first time I'm using target_link_lib for a library self. The reason 
is not clear for me. What happens under the hood here?

Thanks,
Olaf



More information about the CMake mailing list