cmake target_link_libraries - unwanted target -


i have problem cmake target_link_libraries.
have 3 libs. first static compiled, second 1 (shared lib) link , third 1 executable use second lib.
problem first lib automatically added third lib , leads "object defined" problem.

is possible hide away first lib third one?

i use cmake 3.4.x compiler: msvc 2010 x64

thanks in advance
tonka

your third "lib" isn't library, application. need add using add_executable, not add_library.

if shared library links in static library, , want link application both static library , shared library, 2 copies of static library. never link static libraries plan use elsewhere shared library, reason. either make first shared (the name implies that's want, describing), or workaround design problem not explicitly link application static library.


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -