<commit_before>add_subdirectory(cpp)

include_directories(${mosquitto_SOURCE_DIR} ${mosquitto_SOURCE_DIR}/lib
			${STDBOOL_H_PATH} ${STDINT_H_PATH}
			${OPENSSL_INCLUDE_DIR})
link_directories(${mosquitto_SOURCE_DIR}/lib)

add_library(libmosquitto SHARED
	logging_mosq.c logging_mosq.h
	memory_mosq.c memory_mosq.h
	messages_mosq.c messages_mosq.h
	mosquitto.c mosquitto.h
	mqtt3_protocol.h
	net_mosq.c net_mosq.h
	read_handle.c read_handle.h
	read_handle_client.c
	read_handle_shared.c
	send_client_mosq.c
	send_mosq.c send_mosq.h
	thread_mosq.c
	util_mosq.c util_mosq.h
	will_mosq.c will_mosq.h)

option(WITH_THREADING
	"Include client library threading support?" ON)
if (${WITH_THREADING} STREQUAL ON AND NOT WIN32)
	add_definitions("-DWITH_THREADING")
	set (PTHREAD_LIBRARIES pthread)
else (${WITH_THREADING} STREQUAL ON AND NOT WIN32)
	set (PTHREAD_LIBRARIES "")
endif (${WITH_THREADING} STREQUAL ON AND NOT WIN32)

if (WIN32)
	target_link_libraries(libmosquitto ws2_32 ${OPENSSL_LIBRARIES})<commit_msg>CMake support for Redhat win32 pthreads library.<commit_after>add_subdirectory(cpp)

option(WITH_THREADING "Include client library threading support?" ON)
if (${WITH_THREADING} STREQUAL ON)
	add_definitions("-DWITH_THREADING")
	if (WIN32)
		set (PTHREAD_LIBRARIES pthreadVC2)
		set (PTHREAD_INCLUDE_DIR C:\\pthreads\\Pre-built.2\\include)
		set (PTHREAD_LIB_DIR C:\\pthreads\\Pre-built.2\\lib\\x86)
	else (WIN32)
		set (PTHREAD_LIBRARIES pthread)
		set (PTHREAD_INCLUDE_DIR "")
		set (PTHREAD_LIB_DIR "")
	endif (WIN32)
else (${WITH_THREADING} STREQUAL ON)
	set (PTHREAD_LIBRARIES "")
endif (${WITH_THREADING} STREQUAL ON)

include_directories(${mosquitto_SOURCE_DIR} ${mosquitto_SOURCE_DIR}/lib
			${STDBOOL_H_PATH} ${STDINT_H_PATH}
			${OPENSSL_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIR})
link_directories(${mosquitto_SOURCE_DIR}/lib ${PTHREAD_LIB_DIR})

add_library(libmosquitto SHARED
	logging_mosq.c logging_mosq.h
	memory_mosq.c memory_mosq.h
	messages_mosq.c messages_mosq.h
	mosquitto.c mosquitto.h
	mosquitto_internal.h
	mqtt3_protocol.h
	net_mosq.c net_mosq.h
	read_handle.c read_handle.h
	read_handle_client.c
	read_handle_shared.c
	send_client_mosq.c
	send_mosq.c send_mosq.h
	thread_mosq.c
	util_mosq.c util_mosq.h
	will_mosq.c will_mosq.h)

if (WIN32)
	target_link_libraries(libmosquitto ws2_32 ${OPENSSL_LIBRARIES} ${PTHREAD_LIBRARIES})
{'fraction_non_alphanumeric': 0.09995746490854955, 'fraction_numerical': 0.013185878349638452, 'mean_word_length': 6.611650485436893, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '3579398', 'n_tokens_mistral': 1031, 'n_tokens_neox': 963, 'n_words': 161}