FIND_PATH(KDTREE_PATH kdtree++ PATHS /usr /opt /var)

IF (KDTREE_PATH)
   SET(KDTREE_INCLUDE_DIR ${KDTREE_PATH})
   SET(KDTREE_FOUND TRUE)
ELSE (KDTREE_PATH)
   SET(KDTREE_INCLUDE_DIR "NOTFOUND")
   SET(KDTREE_FOUND FALSE)
ENDIF(KDTREE_PATH)

IF (KDTREE_FOUND)
   IF (NOT KDTREE_FIND_QUIETLY)
      MESSAGE(STATUS "Found KDTREE in: ${KDTREE_PATH}")
   ENDIF (NOT KDTREE_FIND_QUIETLY)
ELSE (KDTREE_FOUND)
   IF (KDTREE_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "Could not find KDTREE")
   ENDIF (KDTREE_FIND_REQUIRED)
ENDIF (KDTREE_FOUND)