Changeset - 3f452931af76
[Not reviewed]
0 2 0
Vitaly Takmazov - 10 years ago 2016-01-21 14:39:24
vitalyster@gmail.com
using our DummyConnectionServer* classes (Swiften ones are not installed by default)
2 files changed with 0 insertions and 11 deletions:
0 comments (0 inline, 0 general)
cmake_modules/SwiftenConfig.cmake
Show inline comments
 
FIND_LIBRARY(SWIFTEN_LIBRARY NAMES Swiften Swiften3 HINTS ../lib)
 
FIND_PATH(SWIFTEN_INCLUDE_DIR NAMES "Swiften/Swiften.h" PATH_SUFFIXES libSwiften Swiften HINTS ../include)
 

	
 
if( SWIFTEN_LIBRARY AND SWIFTEN_INCLUDE_DIR )
 
	find_program(SWIFTEN_CONFIG_EXECUTABLE NAMES swiften-config DOC "swiften-config executable" HINTS ../bin)
 
	set( SWIFTEN_CFLAGS "" )
 
	if (SWIFTEN_CONFIG_EXECUTABLE)
 
		execute_process(
 
			COMMAND ${SWIFTEN_CONFIG_EXECUTABLE} --version
 
			OUTPUT_VARIABLE SWIFTEN_VERSION)
 
		string(REGEX MATCH "([0-9])" SWIFTEN_VERSION "${SWIFTEN_VERSION}")
 
		message(STATUS "Swiften version ${SWIFTEN_VERSION}")
 
		execute_process(
 
			COMMAND ${SWIFTEN_CONFIG_EXECUTABLE} --libs
 
			OUTPUT_VARIABLE SWIFTEN_LIB)
 
		string(REGEX REPLACE "[\r\n]"                  " " SWIFTEN_LIB "${SWIFTEN_LIB}")
 
		string(REGEX REPLACE " +$"                     ""  SWIFTEN_LIB "${SWIFTEN_LIB}")
 
		set(SWIFTEN_LIBRARY "")
 
		if (APPLE)
 
			string(REGEX MATCHALL "-framework [A-Za-z]+" APPLE_FRAMEWORKS "${SWIFTEN_LIB}")
 
			foreach(framework ${APPLE_FRAMEWORKS})
 
				list(APPEND SWIFTEN_LIBRARY ${framework} )
 
			endforeach(framework)
 
			string(REGEX REPLACE "-framework [A-Za-z]+" "" SWIFTEN_LIB "${SWIFTEN_LIB}")
 
		endif(APPLE)
 
		string(REGEX REPLACE " " ";" SWIFTEN_LIB "${SWIFTEN_LIB}")
 
		foreach(f ${SWIFTEN_LIB})
 
			STRING(SUBSTRING ${f} 0 2 f_out)
 
			STRING(COMPARE EQUAL ${f_out} "/L" IS_PATH)
 
			if(${IS_PATH})
 
				string(REGEX REPLACE "/LIBPATH:" ""  f_replaced "${f}")
 
				message("Added link directory: ${f_replaced}")
 
				link_directories(${f_replaced})
 
			else()
 
				list(APPEND SWIFTEN_LIBRARY ${f})
 
			endif()
libtransport/CMakeLists.txt
Show inline comments
 
cmake_minimum_required(VERSION 2.6)
 
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()
 
if (SWIFTEN_VERSION GREATER 2)
 
	list(REMOVE_ITEM SWIFTEN_SRC "${CMAKE_CURRENT_SOURCE_DIR}/../include/Swiften/Network/DummyConnectionServer.h")
 
	list(REMOVE_ITEM SWIFTEN_SRC "${CMAKE_CURRENT_SOURCE_DIR}/../include/Swiften/Network/DummyConnectionServerFactory.h")
 
	list(REMOVE_ITEM SWIFTEN_SRC "${CMAKE_CURRENT_SOURCE_DIR}/../include/Swiften/Network/DummyConnectionServer.cpp")
 
	list(REMOVE_ITEM SWIFTEN_SRC "${CMAKE_CURRENT_SOURCE_DIR}/../include/Swiften/Network/DummyConnectionServerFactory.cpp")
 
endif()
 
FILE(GLOB HEADERS ../include/transport/*.h)
 
include_directories(../spectrum/src/frontends/xmpp/)
 

	
 
if (NOT WIN32)
 
include_directories(${POPT_INCLUDE_DIR})
 
endif()
 

	
 
# SOURCE_GROUP(headers FILES ${HEADERS})
 

	
 

	
 
if (PROTOBUF_FOUND)
 
	if (NOT WIN32)
 
		ADD_LIBRARY(transport SHARED ${HEADERS} ${SRC} ${SWIFTEN_SRC})
 
	else()
 
		ADD_LIBRARY(transport STATIC ${HEADERS} ${SRC} ${SWIFTEN_SRC})
 
	endif()
 
#	SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/../include/transport/protocol.pb.cc PROPERTIES GENERATED 1)
 
	ADD_DEPENDENCIES(transport pb) 
 
else(PROTOBUF_FOUND)
 
	ADD_LIBRARY(transport SHARED ${HEADERS} ${SRC} ${SWIFTEN_SRC})
 
endif(PROTOBUF_FOUND)
 

	
 
# if (CMAKE_COMPILER_IS_GNUCXX)
 
	if (NOT WIN32)
0 comments (0 inline, 0 general)