<div dir="ltr">if it exists as a target; I need to know the path to the built library for subsequent projects to link against.  I have to manually add the option -L<path to build library) -lbaselibname to avoid having the full path linked into the resulting .so.<div>
<br></div><div>if I just use 'add_link_library' then the resulting library will not load except on the system that built it, because the library name references contain paths to the libs not just the libname.</div>
<div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 26, 2014 at 1:49 PM, Hendrik Sattler <span dir="ltr"><<a href="mailto:post@hendrik-sattler.de" target="_blank">post@hendrik-sattler.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Maybe you can explain _why_ you need to do it this way? Can it be solved more inline with the better cross-compile support in cmake-3.0?<br>
<br><div class="gmail_quote"><div><div class="h5">On 26. Mai 2014 19:29:20 MESZ, J Decker <<a href="mailto:d3ck0r@gmail.com" target="_blank">d3ck0r@gmail.com</a>> wrote:</div></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><div class="h5">
<div dir="ltr">So... no alternatives to location in this instance?  </div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, May 24, 2014 at 7:28 PM, J Decker <span dir="ltr"><<a href="mailto:d3ck0r@gmail.com" target="_blank">d3ck0r@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>CMake Warning (dev) at C:/general/build/android/karaway/debug_out/core/DefaultInstall.cmake:203 (get_property):</div>

<div>  Policy CMP0026 is not set: Disallow use of the LOCATION target property.</div>
<div>  Run "cmake --help-policy CMP0026" for policy details.  Use the cmake_policy</div><div>  command to set the policy and suppress this warning.</div><div><br></div><div>  The LOCATION property should not be read from target "keypad.isp".  Use the</div>


<div>  target name directly with add_custom_command, or use the generator</div><div>  expression $<TARGET_FILE>, as appropriate.</div><div><br></div><div>Call Stack (most recent call first):</div><div>  security.null/CMakeLists.txt:23 (my_target_link_libraries)</div>


<div>This warning is for project developers.  Use -Wno-dev to suppress it.</div><div><br></div><div><br></div><div>-------------</div><div><br></div><div><div>macro(my_target_link_libraries target )</div><div>    if(CMAKE_COMPILER_IS_GNUCC AND __ANDROID__ )<br>


</div><div>       foreach( target_lib ${ARGN} )<br></div><div>          if( TARGET ${target_lib} )<br></div><div>             get_property( lib_path TARGET ${target_lib} PROPERTY LOCATION)<br></div><div>             get_property( existing_outname TARGET ${target_lib} PROPERTY OUTPUT_NAME )<br>


</div><div>             if( NOT existing_outname )<br></div><div><span style="white-space:pre-wrap">  </span>set( existing_outname ${target_lib} )<br></div><div>             endif( NOT existing_outname )<br></div><div>
             if( ${lib_path} MATCHES "(.*)/([^/]*)$" )<br></div><div>                get_target_property(existing_link_flags ${target} LINK_FLAGS)<br></div><div>                if(existing_link_flags)<br></div>

<div>
                    set(new_link_flags "${existing_link_flags} -L ${CMAKE_MATCH_1} -l ${existing_outname}")<br></div><div>                else()<br></div><div>                    set(new_link_flags "-L ${CMAKE_MATCH_1} -l ${existing_outname}")<br>


</div><div>                endif()<br></div><div>                set_target_properties( ${target} PROPERTIES LINK_FLAGS ${new_link_flags})<br></div><div><span style="white-space:pre-wrap"> </span>         add_dependencies( ${target} ${target_lib} )<br>


</div><div>             endif( ${lib_path} MATCHES "(.*)/([^/]*)$" )<br></div><div>          else()<br></div><div>             target_link_libraries( ${target} ${target_lib} )<br></div><div>          endif( TARGET ${target_lib} )<br>


</div><div>       endforeach( target_lib ${ARGN} )<br></div><div>    else()<br></div><div><span style="white-space:pre-wrap"> </span>target_link_libraries( ${target} ${ARGN} )<br></div><div>    endif()<br></div><div>endmacro()<br>


</div><div><br></div></div><div>----------------------</div><div>In the script I'm getting LOCATION to know if the referenced library is a full pathname or a short  name so I can strip the path appropriately... I don't think the target_file solution works here, what other alternative is there?</div>


</div>
</blockquote></div><br></div>
<p style="margin-top:2.5em;margin-bottom:1em;border-bottom:1px solid #000"></p></div></div><pre>-- <br><br>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br><br>Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br><br>CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br><br>Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a></pre></blockquote></div><span class="HOEnZb"><font color="#888888"><br>
-- <br>
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.</font></span></div><br>--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br></div>