<div class="gmail_quote">On Tue, Feb 10, 2009 at 1:01 PM, Brad King <span dir="ltr">&lt;<a href="mailto:brad.king@kitware.com">brad.king@kitware.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Bill&#39;s example will not work as written. &nbsp;The target_link_libraries command<br>
does not work for imported targets. &nbsp;See IMPORTED target and general<br>
packaging documentation here:<br>
<br>
 &nbsp;<a href="http://www.cmake.org/Wiki/CMake_2.6_Notes#Exporting_and_Importing_Targets" target="_blank">http://www.cmake.org/Wiki/CMake_2.6_Notes#Exporting_and_Importing_Targets</a><br>
 &nbsp;<a href="http://www.cmake.org/Wiki/CMake_2.6_Notes#Packages" target="_blank">http://www.cmake.org/Wiki/CMake_2.6_Notes#Packages</a><br>
<br>
CMake 2.6 makes it easy to export targets from one project (either its<br>
build tree or install tree) for use by another project.<br></blockquote><div><br>Is this the easiest way to register dependencies of IMPORTED static libraries against each other?&nbsp; I&#39;m just curious if there are plans to make target_link_libraries() work for this or is there a technical problem allowing it?<br>
<br>project(Foo)<br>cmake_minimum_required(VERSION 2.6)<br><br>add_library(baz STATIC IMPORTED)<br>set_target_properties(baz PROPERTIES<br>&nbsp;&nbsp;&nbsp; IMPORTED_LOCATION&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ${CMAKE_CURRENT_SOURCE_DIR}/libbaz.a<br>&nbsp;&nbsp;&nbsp; IMPORTED_LOCATION_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/libbaz.a<br>
&nbsp;&nbsp;&nbsp; IMPORTED_LOCATION_DEBUG&nbsp;&nbsp; ${CMAKE_CURRENT_SOURCE_DIR}/libbazd.a)<br><br>add_library(bar STATIC IMPORTED)<br>set_target_properties(bar PROPERTIES<br>&nbsp;&nbsp;&nbsp; IMPORTED_LOCATION&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ${CMAKE_CURRENT_SOURCE_DIR}/libbar.a<br>
&nbsp;&nbsp;&nbsp; IMPORTED_LOCATION_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/libbar.a<br>&nbsp;&nbsp;&nbsp; IMPORTED_LOCATION_DEBUG&nbsp;&nbsp; ${CMAKE_CURRENT_SOURCE_DIR}/libbard.a)<br><br>#target_link_libraries(bar baz) # no worky<br>get_target_property(baz_loc&nbsp;&nbsp;&nbsp;&nbsp; baz IMPORTED_LOCATION)<br>
get_target_property(baz_loc_rel baz IMPORTED_LOCATION_RELEASE)<br>get_target_property(baz_loc_deb baz IMPORTED_LOCATION_DEBUG)<br>set_target_properties(bar PROPERTIES<br>&nbsp;&nbsp;&nbsp; IMPORTED_LINK_INTERFACE_LIBRARIES&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ${baz_loc}<br>
&nbsp;&nbsp;&nbsp; IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE ${baz_loc_rel}<br>&nbsp;&nbsp;&nbsp; IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG&nbsp;&nbsp; ${baz_loc_deb})<br><br>add_executable(foo foo.cc)<br>target_link_libraries(foo bar) # dependency on baz is implied<br>
<br></div></div><br>-- <br>Philip Lowman<br>