Stephen Kelly wrote:

>> Other possible names?  Perhaps LINK_PUBLIC and LINK_PRIVATE?
>> Perhaps LINK AND LINK_ONLY?
> 
> I'll implement it as you suggest with LINK_PUBLIC and LINK_PRIVATE, which
> are most clear to me. We can change it once we have an implementation to
> talk about.

Well that didn't take long. I pushed a target-link-libraries-interfaces 
branch to stage.

In the branch:


target_link_libraries(foo
LINK_PRIVATE
  qtxml
LINK_PUBLIC
  qtcore
  qtnetwork
)

and

target_link_libraries(foo
LINK_PUBLIC
  qtcore
  qtnetwork
LINK_PRIVATE
  qtxml
)

are equivalent to:

target_link_libraries(foo
  qtcore
  qtnetwork
  qtxml
)
target_link_libraries(foo
LINK_INTERFACE_LIBRARIES
  qtcore
  qtnetwork
)

both mean:

* foo will link against qtxml, qtcore and qtnetwork
* qtcore and qtnetwork will be in the LINK_INTERFACE_LIBRARIES

...

target_link_libraries(foo
LINK_PUBLIC
  qtcore
  qtnetwork
)

is equivalent to 

target_link_libraries(foo
  qtcore
  qtnetwork
)

* foo will link against qtcore and qtnetwork

...

target_link_libraries(foo
LINK_PRIVATE
  qtcore
)

is equivalent to:

target_link_libraries(foo
  qtcore
)
target_link_libraries(foo
  TARGET_LINK_LIBRARIES ""
)

* foo will link against qtcore
* qtcore will not be in the LINK_INTERFACE_LIBRARIES

...

target_link_libraries(foo
LINK_PRIVATE
  qtxml
)
target_link_libraries(foo
LINK_PUBLIC
  qtcore
  qtnetwork
)

is equivalent to:

target_link_libraries(foo
  qtcore
  qtxml
  qtnetwork
)
target_link_libraries(foo
TARGET_LINK_LIBRARIES 
  qtcore
  qtnetwork
)

* foo will link against qtxml, qtcore and qtnetwork
* qtcore and qtnetwork will be in the LINK_INTERFACE_LIBRARIES




What do you think?

Thanks,

Steve.


--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to