<commit_before>INCLUDE_DIRECTORIES (
	${CSOCKETS_INCLUDE_DIRS}
	${GUILE_INCLUDE_DIRS}
)

ADD_LIBRARY (builtinreqs SHARED
	BuiltinRequestsModule
	Request
	DataRequest
	ExitRequest
	HelpRequest
	LoadRequest
	SaveRequest
	LoadModuleRequest
	ListRequest
	ShutdownRequest
	UnloadModuleRequest
)

TARGET_LINK_LIBRARIES(builtinreqs
	xml
)

ADD_LIBRARY (server SHARED
	BaseServer
	CogServer
	Request
	NetworkServer
	ConsoleSocket
	SocketHolder
	Agent
	SystemActivityTable
	load-file
)

IF (GUILE_FOUND)
	TARGET_LINK_LIBRARIES(server
		util
		atomspace
		${CSOCKETS_LIBRARIES}
		${OPENSSL_LIBRARIES}
		smob
		xml
	)
ELSE (GUILE_FOUND)
	TARGET_LINK_LIBRARIES(server
		util
		atomspace
		${CSOCKETS_LIBRARIES}
		${OPENSSL_LIBRARIES}
		xml
	)
ENDIF (GUILE_FOUND)

# to ease testing/debugging modules on the source tree
IF (CMAKE_BUILD_TYPE STREQUAL "Debug")
	SET_TARGET_PROPERTIES(server PROPERTIES LINK_FLAGS -Wl,-rpath,${OPENCOG_BINARY_DIR}/opencog/dotty:${OPENCOG_BINARY_DIR}/opencog/ubigraph:${OPENCOG_BINARY_DIR}/opencog/dynamics/attention:${OPENCOG_BINARY_DIR}/opencog/guile:${OPENCOG_BINARY_DIR}/opencog/reasoning/pln:${OPENCOG_BINARY_DIR}/opencog/nlp/parse:${OPENCOG_BINARY_DIR}/opencog/nlp/wsd:${OPENCOG_BINARY_DIR}/opencog/persist:${OPENCOG_BINARY_DIR}/opencog/query:${OPENCOG_BINARY_DIR}/opencog/server:${OPENCOG_BINARY_DIR}/opencog/shell:${OPENCOG_BINARY_DIR}/opencog/util)
ENDIF (CMAKE_BUILD_TYPE STREQUAL "Debug")

ADD_EXECUTABLE(cogserver
	CogServerMain
)

TARGET_LINK_LIBRARIES(cogserver
	server
	${Boost_FILESYSTEM_LIBRARY}
	#${Boost_SIGNALS_LIBRARY}
	${GUILE_LIBRARIES}
)

SET_TARGET_PROPERTIES(cogserver PROPERTIES LINK_DIRECTORIES "${BOOST_LIBRARY_DIRS}")
IF (WIN32)
	SET_TARGET_PROPERTIES(cogserver PROPERTIES LINK_FLAGS "/NODEFAULTLIB:libctm")
ENDIF (WIN32)

INSTALL (TARGETS server cogserver builtinreqs
	RUNTIME DESTINATION "bin"
	LIBRARY DESTINATION "lib${LIB_DIR_SUFFIX}/opencog"
)

INSTALL (FILES
	Agent.h
	BaseServer.h
	BuiltinRequestsModule.h
	CogServer.h
	ConsoleSocket.h
	DataRequest.h
	ExitRequest.h
	Factory.h
	HelpRequest.h
	IHasMimeType.h
	IRPCSocket.h
	ListRequest.h
	load-file.h
	LoadModuleRequest.h
	LoadRequest.h
	SaveRequest.h
	Module.h
	NetworkServer.h
	SystemActivityTable.h
	Registry.h
	Request.h
	ShutdownRequest.h
	UnloadModuleRequest.h
	DESTINATION "include/opencog/server"
)
<commit_msg>load modules always, not just in the debug case!<commit_after>INCLUDE_DIRECTORIES (
	${CSOCKETS_INCLUDE_DIRS}
	${GUILE_INCLUDE_DIRS}
)

ADD_LIBRARY (builtinreqs SHARED
	BuiltinRequestsModule
	Request
	DataRequest
	ExitRequest
	HelpRequest
	LoadRequest
	SaveRequest
	LoadModuleRequest
	ListRequest
	ShutdownRequest
	UnloadModuleRequest
)

TARGET_LINK_LIBRARIES(builtinreqs
	xml
)

ADD_LIBRARY (server SHARED
	BaseServer
	CogServer
	Request
	NetworkServer
	ConsoleSocket
	SocketHolder
	Agent
	SystemActivityTable
	load-file
)

IF (GUILE_FOUND)
	TARGET_LINK_LIBRARIES(server
		util
		atomspace
		${CSOCKETS_LIBRARIES}
		${OPENSSL_LIBRARIES}
		smob
		xml
	)
ELSE (GUILE_FOUND)
	TARGET_LINK_LIBRARIES(server
		util
		atomspace
		${CSOCKETS_LIBRARIES}
		${OPENSSL_LIBRARIES}
		xml
	)
ENDIF (GUILE_FOUND)

# to ease testing/debugging modules on the source tree
# IF (CMAKE_BUILD_TYPE STREQUAL "Debug")
	SET_TARGET_PROPERTIES(server PROPERTIES LINK_FLAGS -Wl,-rpath,${OPENCOG_BINARY_DIR}/opencog/dotty:${OPENCOG_BINARY_DIR}/opencog/ubigraph:${OPENCOG_BINARY_DIR}/opencog/dynamics/attention:${OPENCOG_BINARY_DIR}/opencog/guile:${OPENCOG_BINARY_DIR}/opencog/reasoning/pln:${OPENCOG_BINARY_DIR}/opencog/nlp/parse:${OPENCOG_BINARY_DIR}/opencog/nlp/wsd:${OPENCOG_BINARY_DIR}/opencog/persist:${OPENCOG_BINARY_DIR}/opencog/query:${OPENCOG_BINARY_DIR}/opencog/server:${OPENCOG_BINARY_DIR}/opencog/shell:${OPENCOG_BINARY_DIR}/opencog/util)
# ENDIF (CMAKE_BUILD_TYPE STREQUAL "Debug")

ADD_EXECUTABLE(cogserver
	CogServerMain
)

TARGET_LINK_LIBRARIES(cogserver
	server
	${Boost_FILESYSTEM_LIBRARY}
	#${Boost_SIGNALS_LIBRARY}
	${GUILE_LIBRARIES}
)

SET_TARGET_PROPERTIES(cogserver PROPERTIES LINK_DIRECTORIES "${BOOST_LIBRARY_DIRS}")
IF (WIN32)
	SET_TARGET_PROPERTIES(cogserver PROPERTIES LINK_FLAGS "/NODEFAULTLIB:libctm")
ENDIF (WIN32)

INSTALL (TARGETS server cogserver builtinreqs
	RUNTIME DESTINATION "bin"
	LIBRARY DESTINATION "lib${LIB_DIR_SUFFIX}/opencog"
)

INSTALL (FILES
	Agent.h
	BaseServer.h
	BuiltinRequestsModule.h
	CogServer.h
	ConsoleSocket.h
	DataRequest.h
	ExitRequest.h
	Factory.h
	HelpRequest.h
	IHasMimeType.h
	IRPCSocket.h
	ListRequest.h
	load-file.h
	LoadModuleRequest.h
	LoadRequest.h
	SaveRequest.h
	Module.h
	NetworkServer.h
	SystemActivityTable.h
	Registry.h
	Request.h
	ShutdownRequest.h
	UnloadModuleRequest.h
	DESTINATION "include/opencog/server"
)

{'fraction_non_alphanumeric': 0.08712363869314542, 'fraction_numerical': 0.001708306641042067, 'mean_word_length': 6.898819561551433, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6692995', 'n_tokens_mistral': 1993, 'n_tokens_neox': 1902, 'n_words': 262}