INCLUDE_DIRECTORIES (
	${PROJECT_SOURCE_DIR}/opencog/atomspace
	${PROJECT_SOURCE_DIR}/opencog/persist/gearman
)

LINK_DIRECTORIES (
	${PROJECT_BINARY_DIR}/opencog/atomspace
)

LINK_LIBRARIES (
	smob
	atomspace
)

# Make sure that the Gearman job server is running.
# See the README file for details.
FIND_PROGRAM(GEARMAN_JOB_SERVER gearman-job-server)
IF (GEARMAN_JOB_SERVER)
	EXECUTE_PROCESS(COMMAND "ps aux | grep gearmand"
		OUTPUT_VARIABLE OUT
		ERROR_VARIABLE ERR
		RESULT_VARIABLE RC)

	IF (RC)
		MESSAGE(WARNING "gearman-job-server is not running")
	ELSE (RC)
		SET(GEARMAN_RUNNING 1)
		MESSAGE(STATUS "gearman-job-server found")
	ENDIF (RC)

ENDIF (GEARMAN_JOB_SERVER)

IF (GEARMAN_RUNNING)
	ADD_CXXTEST(GearmanUTest)
ENDIF (GEARMAN_RUNNING)

INCLUDE_DIRECTORIES (
	${PROJECT_SOURCE_DIR}/opencog/atomspace
	${PROJECT_SOURCE_DIR}/opencog/persist/gearman
)

LINK_DIRECTORIES (
	${PROJECT_BINARY_DIR}/opencog/atomspace
)

LINK_LIBRARIES (
	smob
	atomspace
)

# Make sure that the Gearman job server is running.
# See the README file for details.
FIND_PROGRAM(GEARMAN_JOB_SERVER gearmand)
IF (GEARMAN_JOB_SERVER)
	EXECUTE_PROCESS(COMMAND "ps" "-C" "gearmand"
		OUTPUT_VARIABLE OUT
		ERROR_VARIABLE ERR
		RESULT_VARIABLE RC)

	IF (RC)
		MESSAGE(WARNING "gearman-job-server is not running; will not run the GearmanUTest")
	ELSE (RC)
		SET(GEARMAN_RUNNING 1)
		MESSAGE(STATUS "gearman-job-server found")
	ENDIF (RC)

ENDIF (GEARMAN_JOB_SERVER)

IF (GEARMAN_RUNNING)
	ADD_CXXTEST(GearmanUTest)
ENDIF (GEARMAN_RUNNING)

Fix up the gearmand search
Fix up the gearmand search
