CMakeLists.txt 2.29 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
set(SDP_GENERATED_SOURCE_FILES
	${CMAKE_CURRENT_BINARY_DIR}/belle_sdpLexer.c
	${CMAKE_CURRENT_BINARY_DIR}/belle_sdpLexer.h
	${CMAKE_CURRENT_BINARY_DIR}/belle_sdpParser.c
	${CMAKE_CURRENT_BINARY_DIR}/belle_sdpParser.h
)
add_custom_command(
	OUTPUT ${SDP_GENERATED_SOURCE_FILES}
	COMMAND java -jar ${ANTLR3_ROOT_DIR}/antlr-3.4-complete.jar -make -fo ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/belle_sdp.g
	DEPENDS belle_sdp.g
)

set(SIP_MESSAGE_GENERATED_SOURCE_FILES
	${CMAKE_CURRENT_BINARY_DIR}/belle_sip_messageLexer.c
	${CMAKE_CURRENT_BINARY_DIR}/belle_sip_messageLexer.h
	${CMAKE_CURRENT_BINARY_DIR}/belle_sip_messageParser.c
	${CMAKE_CURRENT_BINARY_DIR}/belle_sip_messageParser.h
)
add_custom_command(
	OUTPUT ${SIP_MESSAGE_GENERATED_SOURCE_FILES}
	COMMAND java -jar ${ANTLR3_ROOT_DIR}/antlr-3.4-complete.jar -make -fo ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/belle_sip_message.g
	DEPENDS belle_sip_message.g
)

set(SOURCE_FILES
	auth_event.c
	auth_helper.c
	belle_sdp_impl.c
	belle_sip_headers_impl.c
	belle_sip_loop.c
	belle_sip_object.c
	belle_sip_parameters.c
	belle_sip_resolver.c
	belle_sip_uri_impl.c
	belle_sip_utils.c
	channel.c
	dialog.c
	dns.c
	ict.c
	ist.c
	listeningpoint.c
	md5.c
	message.c
	nict.c
	nist.c
	port.c
	provider.c
	refresher.c
	siplistener.c
	sipstack.c
	transaction.c
	transports/stream_channel.c
	transports/stream_listeningpoint.c
	transports/tls_channel_polarssl.c
	transports/tls_listeningpoint_polarssl.c
	transports/udp_channel.c
	transports/udp_listeningpoint.c
	${SDP_GENERATED_SOURCE_FILES}
	${SIP_MESSAGE_GENERATED_SOURCE_FILES}
)

add_definitions(
	-DBELLESIP_EXPORTS
	-DBELLESIP_INTERNAL_EXPORTS
	-DHAVE_POLARSSL
	-DHAVE_ANTLR_STRING_STREAM_NEW
	-DHAVE_COMPILER_TLS
	-DPACKAGE_VERSION="1.2.4"
)

if(WIN32)
set(LIBS ws2_32)
endif(WIN32)
set(LIBS ${LIBS} libantlr3c libpolarssl)

add_library(libbellesip SHARED ${SOURCE_FILES})
set_target_properties(libbellesip PROPERTIES VERSION 1.2.4 SOVERSION 1)

target_link_libraries(libbellesip ${LIBS})

install(TARGETS libbellesip
		COMPONENT COMP_libbellesip
        DESTINATION ${LIB_INSTALL_DIR}
        PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)

if(USE_INSTALLED_COMPONENTS)
	add_dependencies(libbellesip
		INSTALL_libantlr3c
		INSTALL_libpolarssl
		INSTALL_libortp)
endif()