Based on --help-property I can't really tease them apart.  It looks like
LINK_INTERFACE_LIBRARIES is old and INTERFACE_LINK_LIBRARIES is new, but I
can't really figure out what the change is.

In my project, I have a hierarchy of static libraries connected by
TARGET_LINK_LIBRARIES(... LINK_PUBLIC ...) and I can get to this
information with LINK_INTERFACE_LIBRARIES on linux, but on OSX it appears
to not be there with LINK_INTERFACE_LIBRARIES, but INTERFACE_LINK_LIBRARIES
does work.  I would like to understand the difference and version support
before I start using it.

1. Which versions support INTERFACE_LINK_LIBRARIES?
2. What are the differences between them?
3. There also seems to be a difference (for ADD_LIBRARY) between
LINK_PUBLIC/LINK_PRIVATE and (what I believe are newer) PUBLIC/PRIVATE, but
what are the differences here?

For example, I've used the below CMakeLists.txt and gotten the below
output.  Clearly there is some difference ($<LINK_ONLY:a>), but what does
it mean?

CMakeLists.txt:

"""
project(test)

add_library(a STATIC a)
add_library(b STATIC b)
target_link_libraries(b a)
add_library(c STATIC c)
target_link_libraries(c LINK_PRIVATE a)
add_library(d STATIC d)
target_link_libraries(d LINK_PUBLIC a)
add_library(e STATIC e)
target_link_libraries(e PRIVATE a)
add_library(f STATIC f)
target_link_libraries(f PUBLIC a)

foreach (lib a b c d e f)
  get_property(lil TARGET ${lib} PROPERTY LINK_INTERFACE_LIBRARIES)
  get_property(ill TARGET ${lib} PROPERTY INTERFACE_LINK_LIBRARIES)
  message(STATUS "${lib}: LINK_INTERFACE_LIBRARIES = \"${lil}\"
INTERFACE_LINK_LIBRARIES = \"${ill}\"")
endforeach ()
"""

output:

"""
-- a: LINK_INTERFACE_LIBRARIES = "" INTERFACE_LINK_LIBRARIES = ""
-- b: LINK_INTERFACE_LIBRARIES = "" INTERFACE_LINK_LIBRARIES = "a"
-- c: LINK_INTERFACE_LIBRARIES = "" INTERFACE_LINK_LIBRARIES =
"$<LINK_ONLY:a>"
-- d: LINK_INTERFACE_LIBRARIES = "a" INTERFACE_LINK_LIBRARIES = "a"
-- e: LINK_INTERFACE_LIBRARIES = "" INTERFACE_LINK_LIBRARIES =
"$<LINK_ONLY:a>"
-- f: LINK_INTERFACE_LIBRARIES = "a" INTERFACE_LINK_LIBRARIES = "a"
"""

-- 
Cheers,
Leif
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to