FindArchive.cmake 982 Bytes
# - Try to find the libarchive libraries
# Once done this will define
#
# libarchive_FOUND - flag that indicates libarchive is installed
# libarchive_INCLUDE_DIR - the libarchive include directory
# libarchive_LIBRARIES - the libarchive library directory

FIND_PATH(libarchive_INCLUDE_DIR archive.h PATHS ${USERLOCAL_ROOT}/include /usr/include NO_DEFAULT_PATH)
FIND_LIBRARY(libarchive_LIBRARIES NAMES archive PATHS ${USERLOCAL_ROOT}/lib /usr/lib NO_DEFAULT_PATH)

# set FOUND flag
IF(libarchive_INCLUDE_DIR AND libarchive_LIBRARIES)
	SET(libarchive_FOUND 1)
	if(NOT libarchive_FIND_QUIETLY)
		message(STATUS "Found libarchive: ${libarchive_LIBRARIES}")
	endif(NOT libarchive_FIND_QUIETLY)
ELSE(libarchive_INCLUDE_DIR AND libarchive_LIBRARIES)
	SET(libarchive_FOUND 0 CACHE BOOL "Not found libarchive library")
	message(STATUS "NOT Found libarchive, disabling it")
ENDIF(libarchive_INCLUDE_DIR AND libarchive_LIBRARIES)

MARK_AS_ADVANCED(libarchive_INCLUDE_DIR libarchive_LIBRARIES)