SET(CUNIT_SEARCH_PATHS
    /usr/local/
    /usr
    /opt
)

FIND_PATH(CUNIT_INCLUDE_DIR CUnit/CUnit.h 
    HINTS 
    PATH_SUFFIXES include
    PATHS ${CUNIT_SEARCH_PATHS}
)
FIND_LIBRARY(CUNIT_LIBRARY cunit 
    HINTS
    PATH_SUFFIXES lib64 lib bin
    PATHS ${CUNIT_SEARCH_PATHS}
)

IF(CUNIT_INCLUDE_DIR AND CUNIT_LIBRARY)
   SET(CUNIT_FOUND TRUE)
ENDIF(CUNIT_INCLUDE_DIR AND CUNIT_LIBRARY)

IF(CUNIT_FOUND)
    MESSAGE(STATUS "Found CUnit: ${CUNIT_LIBRARY}")
ELSE(CUNIT_FOUND)
    MESSAGE(STATUS "Could not find CUnit. Tests will not be available.")
ENDIF(CUNIT_FOUND)
