find_package(MRPT REQUIRED base maps obs)
include_directories(${MRPT_INCLUDE_DIRS})
#add_definitions(-DUSE_MRPT)

include_directories(../libs/PlaneSLAM)
include_directories(../libs/PlaneDetect)
include_directories(../libs/DrawingUtils)
include_directories(../)

find_package(PCL REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
#link_directories(/opt/ros/indigo/lib)
#include_directories(/opt/ros/indigo/include)

set(ALL_LIBS 
  ${MRPT_LIBS} GL 
  nrtCore nrtPointCloud2 nrtGraphics nrtImageProc 
  planeslam planedetect picp util
  boost_serialization boost_thread boost_system 
  gtsam 
  pthread
  X11 gflags
  drawing_utils tbb configuration opencv_core opencv_highgui opencv_imgproc)

add_executable(test-LiDARPlaneDetection test-LiDARPlaneDetection.C 
  #PolygonUtils.C
  OctomapUtils.C
  IOUtils.C
  ../External/lodepng.cpp
  MessageReader.C
  ../../PointCloud/Features/VelodynePlanarity.C
  )
target_link_libraries(test-LiDARPlaneDetection 
  ${ALL_LIBS})

add_executable(test-Ellipse test-Ellipse.C 
  #PolygonUtils.C
  OctomapUtils.C
  IOUtils.C
  ../External/lodepng.cpp
  MessageReader.C
  ../../PointCloud/Features/VelodynePlanarity.C
  )
target_link_libraries(test-Ellipse 
  ${ALL_LIBS})


add_executable(nrt2ros nrt2ros.C IOUtils.C MessageReader.C)
target_link_libraries(nrt2ros ${ALL_LIBS} ${PCL_LIBRARIES} rosbag rosbag_storage rostime console_bridge roscpp_serialization)


add_executable(test-NormalsFLAS test-NormalsFLAS.C MessageReader.C 
  ../../PointCloud/Features/VelodyneNormalsFLAS.C
  ../../PointCloud/Features/VelodynePlanarity.C
  ../../PointCloud/Features/RangeImage.C
  ../../PointCloud/Features/Planes/details/FrameTiming.C
  )
  
target_link_libraries(test-NormalsFLAS nrtCore nrtGraphics nrtPointCloud2 boost_thread boost_system opencv_core opencv_highgui opencv_imgproc)

add_executable(test-MakeVideos test-MakeVideos.C MessageReader.C 
  ../../PointCloud/Features/Planes/details/FrameTiming.C
  IOUtils.C MessageReader.C
  ../../PointCloud/Registration/PlaneConstraint.C
  )
target_link_libraries(test-MakeVideos ${ALL_LIBS})

#
#
##add_executable(test-Polygon test-Polygon.C)
##target_link_libraries(test-Polygon nrtCore nrtImageProc boost_thread boost_system)
##
#add_executable(test-PlaneConstraint test-PlaneConstraint.C ../../PointCloud/Registration/PlaneConstraint.C)
#target_link_libraries(test-PlaneConstraint gtsam boost_system boost_thread nrtPointCloud2 nrtCore)
