I have the following CMake projects:
testexe
: which depends on shared library testlib
testlib
: shared library which uses a third party DLL, say test3rd.lib
After generating the solution, I found that everything was fine except testexe
requires test3rd.lib
as well as testlib
, but my test should only depend on testlib
.
What is the reason for this extra dependency?
You could link test3rd.lib
as a PRIVATE
dependency of testlib
, PUBLIC
is default.
target_link_libraries(testlib PRIVATE test3rd.lib)
Reference