
set(QT_DONT_USE_QTGUI "YES")
include(${QT_USE_FILE})

set(INC_DIR ${CMAKE_SOURCE_DIR}/include)
set(common_DIR ${CMAKE_SOURCE_DIR}/src/Common)
include_directories(${INC_DIR} ${QT_QTCORE_INCLUDE_DIR} ${QTDBUS_CFLAGS})

# ######### QtTelepathyCommon library #########

set(common_SRCS
    ${common_DIR}/channel_interface_call_state_types_gen.cpp
    ${common_DIR}/channel_interface_chat_state_types_gen.cpp
    ${common_DIR}/channel_interface_dtmf_types_gen.cpp
    ${common_DIR}/channel_interface_group_types_gen.cpp
    ${common_DIR}/channel_interface_hold_types_gen.cpp
    ${common_DIR}/channel_interface_media_signalling_types_gen.cpp
    ${common_DIR}/channel_interface_password_types_gen.cpp
    ${common_DIR}/channel_type_room_list_types_gen.cpp
    ${common_DIR}/channel_type_streamed_media_types_gen.cpp
    ${common_DIR}/channel_type_text_types_gen.cpp
    ${common_DIR}/channel_type_tubes_types_gen.cpp
    ${common_DIR}/connection_interface_aliasing_types_gen.cpp
    ${common_DIR}/connection_interface_capabilities_types_gen.cpp
    ${common_DIR}/connection_interface_presence_types_gen.cpp
    ${common_DIR}/connection_manager_types_gen.cpp
    ${common_DIR}/connection_types_gen.cpp
    ${common_DIR}/media_stream_handler_types_gen.cpp
    ${common_DIR}/properties_interface_types_gen.cpp
    ${common_DIR}/types.cpp
)

set(library_SRCS
    ${common_SRCS}
    channel_interface_call_state_types_gen.cpp
    channel_interface_chat_state_types_gen.cpp
    channel_interface_dtmf_types_gen.cpp
    channel_interface_group_types_gen.cpp
    channel_interface_hold_types_gen.cpp
    channel_interface_media_signalling_types_gen.cpp
    channel_interface_password_types_gen.cpp
    channel_type_room_list_types_gen.cpp
    channel_type_streamed_media_types_gen.cpp
    channel_type_text_types_gen.cpp
    channel_type_tubes_types_gen.cpp
    connection_interface_aliasing_types_gen.cpp
    connection_interface_capabilities_types_gen.cpp
    connection_interface_presence_types_gen.cpp
    connection_manager_types_gen.cpp
    connection_types_gen.cpp
    media_stream_handler_types_gen.cpp
    properties_interface_types_gen.cpp
    types.cpp
)

set(library_MOC_HDRS
    ${INC_DIR}/QtTelepathy/Common/channel_interface_call_state_types_gen.h
    ${INC_DIR}/QtTelepathy/Common/channel_interface_call_state_types.h
    ${INC_DIR}/QtTelepathy/Common/channel_interface_chat_state_types_gen.h
    ${INC_DIR}/QtTelepathy/Common/channel_interface_chat_state_types.h
    ${INC_DIR}/QtTelepathy/Common/channel_interface_dtmf_types_gen.h
    ${INC_DIR}/QtTelepathy/Common/channel_interface_dtmf_types.h
    ${INC_DIR}/QtTelepathy/Common/channel_interface_group_types_gen.h
    ${INC_DIR}/QtTelepathy/Common/channel_interface_group_types.h
    ${INC_DIR}/QtTelepathy/Common/channel_interface_hold_types_gen.h
    ${INC_DIR}/QtTelepathy/Common/channel_interface_hold_types.h
    ${INC_DIR}/QtTelepathy/Common/channel_interface_media_signalling_types_gen.h
    ${INC_DIR}/QtTelepathy/Common/channel_interface_media_signalling_types.h
    ${INC_DIR}/QtTelepathy/Common/channel_interface_password_types_gen.h
    ${INC_DIR}/QtTelepathy/Common/channel_interface_password_types.h
    ${INC_DIR}/QtTelepathy/Common/channel_type_room_list_types_gen.h
    ${INC_DIR}/QtTelepathy/Common/channel_type_room_list_types.h
    ${INC_DIR}/QtTelepathy/Common/channel_type_streamed_media_types_gen.h
    ${INC_DIR}/QtTelepathy/Common/channel_type_streamed_media_types.h
    ${INC_DIR}/QtTelepathy/Common/channel_type_text_types_gen.h
    ${INC_DIR}/QtTelepathy/Common/channel_type_text_types.h
    ${INC_DIR}/QtTelepathy/Common/channel_type_tubes_types_gen.h
    ${INC_DIR}/QtTelepathy/Common/channel_type_tubes_types.h
    ${INC_DIR}/QtTelepathy/Common/common_export.h
    ${INC_DIR}/QtTelepathy/Common/connection_interface_aliasing_types_gen.h
    ${INC_DIR}/QtTelepathy/Common/connection_interface_aliasing_types.h
    ${INC_DIR}/QtTelepathy/Common/connection_interface_capabilities_types_gen.h
    ${INC_DIR}/QtTelepathy/Common/connection_interface_capabilities_types.h
    ${INC_DIR}/QtTelepathy/Common/connection_interface_presence_types_gen.h
    ${INC_DIR}/QtTelepathy/Common/connection_interface_presence_types.h
    ${INC_DIR}/QtTelepathy/Common/connection_manager_types_gen.h
    ${INC_DIR}/QtTelepathy/Common/connection_manager_types.h
    ${INC_DIR}/QtTelepathy/Common/connection_types_gen.h
    ${INC_DIR}/QtTelepathy/Common/connection_types.h
    ${INC_DIR}/QtTelepathy/Common/generic_types_gen.h
    ${INC_DIR}/QtTelepathy/Common/generic_types.h
    ${INC_DIR}/QtTelepathy/Common/media_stream_handler_types_gen.h
    ${INC_DIR}/QtTelepathy/Common/media_stream_handler_types.h
    ${INC_DIR}/QtTelepathy/Common/properties_interface_types_gen.h
    ${INC_DIR}/QtTelepathy/Common/properties_interface_types.h
    ${INC_DIR}/QtTelepathy/Common/types.h

)
QT4_WRAP_CPP(library_MOC_SRCS ${library_MOC_HDRS})
add_library(QtTelepathyCommon SHARED ${library_SRCS} ${library_MOC_SRCS})
set_target_properties(QtTelepathyCommon PROPERTIES VERSION ${VERSION} SOVERSION ${SO_VERSION})
target_link_libraries(QtTelepathyCommon ${QT_LIBRARIES} ${QDBUS_LDFLAGS})
install(TARGETS QtTelepathyCommon DESTINATION lib)
