[CMake] need help fixing warning message... 3.0

J Decker d3ck0r at gmail.com
Sat May 24 22:28:33 EDT 2014


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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20140524/36a2a132/attachment.html>


More information about the CMake mailing list