From b1dba1cea7fcaa5d666bf74832786fab9d4838ce Mon Sep 17 00:00:00 2001 From: rti Date: Wed, 13 Apr 2011 19:58:41 +0200 Subject: [PATCH] Fixed: Missing objdump binary name in CheckDepends.cmake --- code/CMakeModules/CheckDepends.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/code/CMakeModules/CheckDepends.cmake b/code/CMakeModules/CheckDepends.cmake index 951450e2b..d2fbe06e1 100644 --- a/code/CMakeModules/CheckDepends.cmake +++ b/code/CMakeModules/CheckDepends.cmake @@ -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 # 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) +