if(WITH_CERES)
  find_package(Ceres)
  if(${Ceres_FOUND})
    set(CERES_LIBRARIES "${CERES_LIBRARIES}")
    set(CERES_INCLUDE_DIRS "${CERES_INCLUDES}")
    set(HAVE_CERES TRUE)
    if(${Ceres_VERSION} EQUAL 1.8.0)
     add_definitions(-DCERES_VERSION_LESS_1_9_0)
    endif(${Ceres_VERSION} EQUAL 1.8.0)
  else()
    message(FATAL_ERROR "libceres not found. Install it or disable WITH_CERES")
  endif()
else()
  add_definitions(-DKP_NO_CERES_AVAILABLE)
endif()

