On 2013-10-17 12:58, James Bigler wrote:
It doesn't seem to work.

I can't use target_link_libraries on an imported target.

add_library(imported_lib STATIC IMPORTED GLOBAL)
set_target_properties(imported_lib PROPERTIES IMPOARTED_LOCATION
"${imported_lib_location}")
target_link_libraries(imported_lib other_lib)

Produces an error:

Attempt to add link library [imported_lib_location] to target imported_lib
which is not built in this directory.

You don't actually want to relink the imported library, just set its interface libraries:

  set_target_properties(imported_lib PROPERTIES
    IMPORTED_LOCATION "${imported_lib_location}"
    IMPORTED_LINK_INTERFACE_LIBRARIES other_lib)

--
Matthew

--

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