OPTION (BUILD_UTILS_PLAYERPRINT "Build the playerprint utility" ON)
IF (BUILD_UTILS_PLAYERPRINT)
    IF (BUILD_PLAYERCC)
        # Possibly use our own copy of XDR or getopt
        IF (NOT HAVE_XDR)
            INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/replace)
        ENDIF (NOT HAVE_XDR)
        IF (NOT HAVE_GETOPT)
            SET (playerreplaceLib playerreplace)
            INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/replace)
        ENDIF (NOT HAVE_GETOPT)
        IF (NOT HAVE_USLEEP)
            SET (playerreplaceLib playerreplace)
            INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/replace)
        ENDIF (NOT HAVE_USLEEP)
        IF (NOT HAVE_GETTIMEOFDAY)
            SET (playerreplaceLib playerreplace)
            INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/replace)
        ENDIF (NOT HAVE_GETTIMEOFDAY)

        INCLUDE_DIRECTORIES (${PROJECT_SOURCE_DIR}/client_libs ${PROJECT_BINARY_DIR}/client_libs)

        LINK_DIRECTORIES (${PLAYERCC_EXTRA_LINK_DIRS})
        PLAYER_ADD_EXECUTABLE (playerprint playerprint.cc ${getoptSrc} ${usleepSrc} ${gettimeofdaySrc})
        TARGET_LINK_LIBRARIES (playerprint playerc++ playerc playerinterface playercommon
                               ${playerreplaceLib} ${PLAYERCC_EXTRA_LINK_LIBRARIES})
    ELSE (BUILD_PLAYERCC)
        MESSAGE (STATUS "playerprint will not be built - playerc++ client library is disabled")
    ENDIF (BUILD_PLAYERCC)
ENDIF (BUILD_UTILS_PLAYERPRINT)
