[CMAKE]: Test if all the previous path checks were sucessful
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
0a65e24cae
commit
8cbec769ba
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user