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.
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. On Mon, May 26, 2014 at 1:49 PM, Hendrik Sattler <[email protected]>wrote: > 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? > > On 26. Mai 2014 19:29:20 MESZ, J Decker <[email protected]> wrote: > >> So... no alternatives to location in this instance? >> >> >> On Sat, May 24, 2014 at 7:28 PM, J Decker <[email protected]> wrote: >> >>> CMake Warning (dev) at >>> C:/general/build/android/karaway/debug_out/core/DefaultInstall.cmake:203 >>> (get_property): >>> Policy CMP0026 is not set: Disallow use of the LOCATION target >>> property. >>> Run "cmake --help-policy CMP0026" for policy details. Use the >>> cmake_policy >>> command to set the policy and suppress this warning. >>> >>> The LOCATION property should not be read from target "keypad.isp". >>> Use the >>> target name directly with add_custom_command, or use the generator >>> expression $<TARGET_FILE>, as appropriate. >>> >>> Call Stack (most recent call first): >>> security.null/CMakeLists.txt:23 (my_target_link_libraries) >>> This warning is for project developers. Use -Wno-dev to suppress it. >>> >>> >>> ------------- >>> >>> macro(my_target_link_libraries target ) >>> if(CMAKE_COMPILER_IS_GNUCC AND __ANDROID__ ) >>> foreach( target_lib ${ARGN} ) >>> if( TARGET ${target_lib} ) >>> get_property( lib_path TARGET ${target_lib} PROPERTY >>> LOCATION) >>> get_property( existing_outname TARGET ${target_lib} >>> PROPERTY OUTPUT_NAME ) >>> if( NOT existing_outname ) >>> set( existing_outname ${target_lib} ) >>> endif( NOT existing_outname ) >>> if( ${lib_path} MATCHES "(.*)/([^/]*)$" ) >>> get_target_property(existing_link_flags ${target} >>> LINK_FLAGS) >>> if(existing_link_flags) >>> set(new_link_flags "${existing_link_flags} -L >>> ${CMAKE_MATCH_1} -l ${existing_outname}") >>> else() >>> set(new_link_flags "-L ${CMAKE_MATCH_1} -l >>> ${existing_outname}") >>> endif() >>> set_target_properties( ${target} PROPERTIES LINK_FLAGS >>> ${new_link_flags}) >>> add_dependencies( ${target} ${target_lib} ) >>> endif( ${lib_path} MATCHES "(.*)/([^/]*)$" ) >>> else() >>> target_link_libraries( ${target} ${target_lib} ) >>> endif( TARGET ${target_lib} ) >>> endforeach( target_lib ${ARGN} ) >>> else() >>> target_link_libraries( ${target} ${ARGN} ) >>> endif() >>> endmacro() >>> >>> ---------------------- >>> 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? >>> >> >> -- >> >> 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 >> >> > -- > Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail > gesendet. > > -- > > 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 >
-- 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
