project(TwoSpirals)

find_package(Qt4)
find_package(OpenGL)
find_package(GLUT)

if(QT_FOUND AND GLUT_FOUND AND GLUT_Xmu_LIBRARY AND NOT CYGWIN_FOUND)
  set(QT_USE_QTMAIN TRUE)
  set(QT_USE_QTOPENGL TRUE)
  include(${QT_USE_FILE})
  add_definitions("${OPENANN_COMPILER_FLAGS} ${QT_DEFINITIONS} -DUSE_QT")
  qt4_wrap_cpp(MOC_OUTPUT_VISUAL TwoSpiralsVisualization.h)
  include_directories(${QT_LIB_DIR})
  add_executable(TwoSpirals twospirals.cpp TwoSpiralsVisualization.cpp ${MOC_OUTPUT_VISUAL})
  target_link_libraries(TwoSpirals openann ${QT_LIBRARIES} ${GLUT_LIBRARY} ${OPENGL_LIBRARY})
else()
  if(NOT QT_FOUND)
    message(WARNING "Qt4 is missing, cannot build TwoSpirals example")
  endif()
  if(NOT GLUT_FOUND)
    message(WARNING "GLUT is missing, cannot build TwoSpirals example")
  endif()
endif()
