CMAKE_MINIMUM_REQUIRED (VERSION 2.4 FATAL_ERROR)
PROJECT (playerc++_examples)

# Include this CMake module to get most of the settings needed to build
SET (CMAKE_MODULE_PATH "@CMAKE_INSTALL_PREFIX@/share/cmake/Modules")
INCLUDE (UsePlayerC++)

SET (HAVE_GETOPT @HAVE_GETOPT@)
IF (NOT HAVE_GETOPT)
    SET (replaceLib "-lplayerreplace")
ENDIF (NOT HAVE_GETOPT)

IF (PLAYER_OS_SOLARIS)
    SET (rtLibFlag -lrt)
ENDIF (PLAYER_OS_SOLARIS)

PLAYER_ADD_PLAYERCPP_CLIENT (camera SOURCES camera.cc LINKFLAGS ${replaceLib})
PLAYER_ADD_PLAYERCPP_CLIENT (example0 SOURCES example0.cc LINKFLAGS ${replaceLib})
PLAYER_ADD_PLAYERCPP_CLIENT (example4 SOURCES example4.cc LINKFLAGS ${replaceLib})
PLAYER_ADD_PLAYERCPP_CLIENT (grip SOURCES grip.cc LINKFLAGS ${replaceLib})
PLAYER_ADD_PLAYERCPP_CLIENT (clientgraphics SOURCES clientgraphics.cc LINKFLAGS ${replaceLib})
PLAYER_ADD_PLAYERCPP_CLIENT (clientgraphics3d SOURCES clientgraphics3d.cc LINKFLAGS ${replaceLib})
PLAYER_ADD_PLAYERCPP_CLIENT (laserobstacleavoid SOURCES laserobstacleavoid.cc LINKFLAGS ${replaceLib})
PLAYER_ADD_PLAYERCPP_CLIENT (ptz SOURCES ptz.cc LINKFLAGS ${replaceLib})
PLAYER_ADD_PLAYERCPP_CLIENT (randomwalk SOURCES randomwalk.cc LINKFLAGS ${replaceLib})
PLAYER_ADD_PLAYERCPP_CLIENT (sonarobstacleavoid SOURCES sonarobstacleavoid.cc LINKFLAGS ${replaceLib})
PLAYER_ADD_PLAYERCPP_CLIENT (speech SOURCES speech.cc LINKFLAGS ${replaceLib})
PLAYER_ADD_PLAYERCPP_CLIENT (wallfollow SOURCES wallfollow.cc LINKFLAGS ${replaceLib})

SET (HAVE_BOOST_THREAD @HAVE_BOOST_THREAD@)
SET (HAVE_BOOST_SIGNALS @HAVE_BOOST_SIGNALS@)

IF (HAVE_BOOST_THREAD AND HAVE_BOOST_SIGNALS)
    PLAYER_ADD_PLAYERCPP_CLIENT (example1 SOURCES example1.cc LINKFLAGS ${rtLibFlag} LINKFLAGS ${replaceLib})
    PLAYER_ADD_PLAYERCPP_CLIENT (example3 SOURCES example3.cc LINKFLAGS ${replaceLib})
    PLAYER_ADD_PLAYERCPP_CLIENT (goto SOURCES goto.cc LINKFLAGS ${rtLibFlag} LINKFLAGS ${replaceLib})
    PLAYER_ADD_PLAYERCPP_CLIENT (speech_cpp_client SOURCES speech_cpp_client.cc LINKFLAGS ${rtLibFlag} LINKFLAGS ${replaceLib})
ENDIF (HAVE_BOOST_THREAD AND HAVE_BOOST_SIGNALS)

IF (HAVE_BOOST_SIGNALS)
    PLAYER_ADD_PLAYERCPP_CLIENT (example2 SOURCES example2.cc LINKFLAGS ${replaceLib})
ENDIF (HAVE_BOOST_SIGNALS)
