On Thu, May 17, 2012 at 2:18 AM, Petr Kmoch <[email protected]> wrote:

> Hi David,
>
> there's a target property LINK_INTERFACE_LIBRARIES (and
> per-configuration variants) which can be used for this purpose.
> Starting with 2.8.7, target_link_libraries() also accepts
> LINK_INTERFACE_LIBRARIES as a new argument mode, setting the property
> instead of linking.
>
> Petr


Petr,

I tried the following, but in both cases (target_link_libraries
and set_target_properties) I still get a linker error that it can't find
TestB().

cmake_minimum_required(VERSION 2.6)
PROJECT(Test)

add_library(TestB TestB.cpp)

# TestA depends on TestB
add_library(TestA TestA.cpp)
#target_link_libraries(TestA LINK_INTERFACE_LIBRARIES TestB)
set_target_properties(TestA PROPERTIES LINK_INTERFACE_LIBRARIES "TestB")

# I want to link to TestA and have it automatically also link to TestB
add_executable(Test Test.cpp)
target_link_libraries(Test TestA)

I have uploaded the entire demo project here:
http://homepages.rpi.edu/~doriad/Upload/TestCMake.tar.gz

Any ideas?

Thanks,

David
--

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://www.cmake.org/mailman/listinfo/cmake

Reply via email to