From 8cbec769ba6226c7eadb0274b4cf7abaf9162bf7 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Sun, 25 Feb 2007 16:52:08 -0300 Subject: [PATCH] [CMAKE]: Test if all the previous path checks were sucessful Signed-off-by: Arnaldo Carvalho de Melo --- cmake/modules/FindDWARF.cmake | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/cmake/modules/FindDWARF.cmake b/cmake/modules/FindDWARF.cmake index 3420b5e..29efa09 100644 --- a/cmake/modules/FindDWARF.cmake +++ b/cmake/modules/FindDWARF.cmake @@ -6,10 +6,10 @@ # DWARF_FOUND - True if fdo found. -IF (DWARF_INCLUDE_DIR) +IF (DWARF_INCLUDE_DIR AND LIBDW_INCLUDE_DIR AND DWARF_LIBRARY AND ELF_LIBRARY) # Already in cache, be silent SET(DWARF_FIND_QUIETLY TRUE) -ENDIF (DWARF_INCLUDE_DIR) +ENDIF (DWARF_INCLUDE_DIR AND LIBDW_INCLUDE_DIR AND DWARF_LIBRARY AND ELF_LIBRARY) FIND_PATH(DWARF_INCLUDE_DIR dwarf.h /usr/local/include @@ -21,7 +21,8 @@ FIND_PATH(LIBDW_INCLUDE_DIR libdw.h /usr/local/include /usr/include /usr/include/elfutils - /usr/local/include/elfutils) + /usr/local/include/elfutils +) FIND_LIBRARY(DWARF_LIBRARY NAMES dw dwarf @@ -33,18 +34,20 @@ FIND_LIBRARY(ELF_LIBRARY PATHS /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64 ) -IF (DWARF_INCLUDE_DIR AND DWARF_LIBRARY AND ELF_LIBRARY) +IF (DWARF_INCLUDE_DIR AND LIBDW_INCLUDE_DIR AND DWARF_LIBRARY AND ELF_LIBRARY) SET(DWARF_FOUND TRUE) SET( DWARF_LIBRARIES ${DWARF_LIBRARY} ${ELF_LIBRARY}) -ELSE (DWARF_INCLUDE_DIR AND DWARF_LIBRARY AND ELF_LIBRARY) +ELSE (DWARF_INCLUDE_DIR AND LIBDW_INCLUDE_DIR AND DWARF_LIBRARY AND ELF_LIBRARY) SET(DWARF_FOUND FALSE) SET( DWARF_LIBRARIES ) -ENDIF (DWARF_INCLUDE_DIR AND DWARF_LIBRARY AND ELF_LIBRARY) +ENDIF (DWARF_INCLUDE_DIR AND LIBDW_INCLUDE_DIR AND DWARF_LIBRARY AND ELF_LIBRARY) IF (DWARF_FOUND) IF (NOT DWARF_FIND_QUIETLY) - MESSAGE(STATUS "Found DWARF: ${DWARF_LIBRARY}") - MESSAGE(STATUS "Found ELF: ${ELF_LIBRARY}") + MESSAGE(STATUS "Found dwarf.h header: ${DWARF_INCLUDE_DIR}") + MESSAGE(STATUS "Found elfutils libdw.h header: ${LIBDW_INCLUDE_DIR}") + MESSAGE(STATUS "Found elfutils libdw library: ${DWARF_LIBRARY}") + MESSAGE(STATUS "Found elfutils libelf library: ${ELF_LIBRARY}") ENDIF (NOT DWARF_FIND_QUIETLY) ELSE (DWARF_FOUND) IF (DWARF_FIND_REQUIRED) @@ -53,8 +56,4 @@ ELSE (DWARF_FOUND) ENDIF (DWARF_FIND_REQUIRED) ENDIF (DWARF_FOUND) -MARK_AS_ADVANCED( - DWARF_LIBRARY - ELF_LIBRARY - DWARF_INCLUDE_DIR -) +MARK_AS_ADVANCED(DWARF_INCLUDE_DIR LIBDW_INCLUDE_DIR DWARF_LIBRARY ELF_LIBRARY)