		file(GLOB SRC *.cpp *.h)
		file(GLOB_RECURSE SWIFTEN_SRC ../include/Swiften/*.cpp)

		# Build without openssl on msvc
		if(NOT MSVC)
			if(APPLE)
				string(REGEX REPLACE "[^;]+;?/Schannel/[^;]+;?" "" SWIFTEN_SRC "${SWIFTEN_SRC}")
				string(REGEX REPLACE "[^;]+;?/OpenSSL/[^;]+;?" "" SWIFTEN_SRC "${SWIFTEN_SRC}")
			else()
				string(REGEX REPLACE "[^;]+;?/Schannel/[^;]+;?" "" SWIFTEN_SRC "${SWIFTEN_SRC}")
				string(REGEX REPLACE "[^;]+;?/SecureTransport/[^;]+;?" "" SWIFTEN_SRC "${SWIFTEN_SRC}")
			endif()
		else()
			string(REGEX REPLACE "[^;]+;?/OpenSSL/[^;]+;?" "" SWIFTEN_SRC "${SWIFTEN_SRC}")
			string(REGEX REPLACE "[^;]+;?/SecureTransport/[^;]+;?" "" SWIFTEN_SRC "${SWIFTEN_SRC}")
		endif()

	file(GLOB HEADERS ../../include/transport/*.h)
	include_directories(../../spectrum/src/frontends/xmpp/)
	if(ENABLE_SLACK_FRONTEND)
	include_directories(../../spectrum/src/frontends/slack/)
	endif()

		if(CPPUNIT_FOUND)
			include_directories(${CMAKE_CURRENT_SOURCE_DIR})
			file(GLOB SRC_TEST *.cpp)
			if(ENABLE_SLACK_FRONTEND)
				file(GLOB SRC_TEST_SLACK slack/*.cpp)
				list(APPEND SRC_TEST ${SRC_TEST_SLACK})
			endif()
			file(GLOB SRC_TEST_FRONTEND_XMPP ../../spectrum/src/frontends/xmpp/*.cpp)
			if(ENABLE_SLACK_FRONTEND)
				file(GLOB SRC_TEST_FRONTEND_SLACK ../../spectrum/src/frontends/slack/*.cpp)
			endif()
			add_executable(libtransport_test ${SRC_TEST} ${SRC_TEST_FRONTEND_XMPP} ${SRC_TEST_FRONTEND_SLACK})
			set_target_properties(libtransport_test PROPERTIES COMPILE_DEFINITIONS LIBTRANSPORT_TEST=1)
			target_link_libraries(libtransport_test transport ${CPPUNIT_LIBRARY} ${Boost_LIBRARIES} JsonCpp::JsonCpp)
			install(TARGETS libtransport_test RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
		endif()
