Basically my code look like this:
LINK_LIBRARIES(Foo)
add_library(StaticLib lib.cpp)
add_executable(Exe)
target_link_library(StaticLib)
set_target_properties(Exe PROPERTIES LINK_LIBRARIES "")
# ^^^^^ I called get_target_property() and confirmed that *Foo* is cleared from the property
But Foo still appeared at the end of the final link command. It seems CMake add what’s LINK_LIBRARIES added twice in the link command.
Is it because Exe linked StaticLib and Foo is its dependency therefor is propagated to Exe? I suppose this shouldn’t be the case because LINK_LIBRARY() won’t affect static library(?)
So any idea why this happened and how can I remove Foo from the link command of Exe?