FIND_PATH(CFA_INCLUDE_DIR cf-algorithms.h PATHS /usr/include/cf-algorithms /usr/local/include/cf-algorithms /opt/local/include/cf-algorithms)

FIND_LIBRARY(CFA NAMES cf-algorithms PATHS /usr/lib /usr/local/lib /opt/local/lib)

IF (CFA)
   SET(CFA_LIBRARIES ${CFA})
ELSE (CFA)
   SET(CFA_LIBRARIES "NOTFOUND")
ENDIF(CFA)

IF (CFA_INCLUDE_DIR AND CFA_LIBRARIES)
   SET(CFA_FOUND TRUE)
ENDIF (CFA_INCLUDE_DIR AND CFA_LIBRARIES)

IF (CFA_FOUND)
   IF (NOT CFA_FIND_QUIETLY)
      MESSAGE(STATUS "Found CFA: ${CFA_LIBRARIES}")
   ENDIF (NOT CFA_FIND_QUIETLY)
ELSE (CFA_FOUND)
   IF (CFA_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "Could not find CFA")
   ENDIF (CFA_FIND_REQUIRED)
ENDIF (CFA_FOUND)