Fixed: Missing objdump binary name in CheckDepends.cmake

This commit is contained in:
rti 2011-04-13 19:58:41 +02:00
parent b895242d66
commit c9753326f0

View file

@ -27,11 +27,16 @@ MACRO(CHECK_UNDEFINED_SYMBOL MYLIBRARY SYMBOL SYMBOL_FOUND)
ENDIF(NOT NM_SYMBOL MATCHES ${SYMBOL})
ENDIF(CMAKE_NM)
ELSEIF(UNIX)
SET(CMAKE_OBJDUMP objdump)
IF(CMAKE_OBJDUMP)
# Use objdump to check if a library is using an external symbol
#MESSAGE(STATUS "exec ${CMAKE_OBJDUMP} -T ${${MYLIBRARY}} | grep ${SYMBOL}")
EXEC_PROGRAM(${CMAKE_OBJDUMP} ARGS "-T ${${MYLIBRARY}} | grep ${SYMBOL}" OUTPUT_VARIABLE OBJDUMP_SYMBOL)
IF(NOT OBJDUMP_SYMBOL MATCHES "UND")
#MESSAGE(STATUS "${${MYLIBRARY}} does not use symbol ${SYMBOL}")
SET(${SYMBOL_FOUND} FALSE)
ELSE(NOT OBJDUMP_SYMBOL MATCHES "UND")
#MESSAGE(STATUS "${${MYLIBRARY}} uses symbol ${SYMBOL}")
ENDIF(NOT OBJDUMP_SYMBOL MATCHES "UND")
ENDIF(CMAKE_OBJDUMP)
ENDIF(WIN32)
@ -64,13 +69,18 @@ MACRO(CHECK_LINKED_LIBRARY MYLIBRARY OTHERLIBRARY LIBRARY_FOUND)
ENDIF(OTOOL_LIBRARY MATCHES "${LIBNAME}")
ENDIF(CMAKE_OTOOL)
ELSEIF(UNIX)
SET(CMAKE_OBJDUMP objdump)
IF(CMAKE_OBJDUMP)
GET_FILENAME_COMPONENT(LIBNAME "${${OTHERLIBRARY}}" NAME)
# TODO: under Solaris use dump -Lv <lib>
# Use objdump to check if a library is linked to another library
#MESSAGE(STATUS "exec ${CMAKE_OBJDUMP} -p ${${MYLIBRARY}} | grep ${LIBNAME}")
EXEC_PROGRAM(${CMAKE_OBJDUMP} ARGS "-p ${${MYLIBRARY}} | grep ${LIBNAME}" OUTPUT_VARIABLE OBJDUMP_LIBRARY)
IF(OBJDUMP_LIBRARY MATCHES "NEEDED")
#MESSAGE(STATUS "${${MYLIBRARY}} references to ${LIBNAME}.")
SET(${LIBRARY_FOUND} TRUE)
ELSE(OBJDUMP_LIBRARY MATCHES "NEEDED")
#MESSAGE(STATUS "${${MYLIBRARY}} does not reference to ${LIBNAME}!")
ENDIF(OBJDUMP_LIBRARY MATCHES "NEEDED")
ENDIF(CMAKE_OBJDUMP)
ENDIF(WIN32)
@ -125,3 +135,4 @@ MACRO(LINK_DEPENDS LIBRARIES MYLIBRARY OTHERLIBRARY SYMBOL)
SET(${OTHERLIBRARY}_LINKED TRUE)
ENDIF(MUST_LINK)
ENDMACRO(LINK_DEPENDS)