From 452b004655fb9e7e4a4586896ee321121b9f1e57 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 3 Jan 2014 15:01:11 +0100 Subject: [PATCH] Add CMakeLists.txt to compile using cmake. --- CMakeLists.txt | 57 ++++++++++++++++++++++ coreapi/CMakeLists.txt | 99 ++++++++++++++++++++++++++++++++++++++ share/CMakeLists.txt | 17 +++++++ share/rings/CMakeLists.txt | 4 ++ 4 files changed, 177 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 coreapi/CMakeLists.txt create mode 100644 share/CMakeLists.txt create mode 100644 share/rings/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..7af5d50ac --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,57 @@ +cmake_minimum_required(VERSION 2.6) +project(LINPHONE C) + +if(NOT ORTP_ROOT_DIR) + set(ORTP_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/oRTP) +endif() +if(NOT ORTP_INCLUDE_DIR) + set(ORTP_INCLUDE_DIR ${ORTP_ROOT_DIR}/include) +endif() +if(NOT MS2_ROOT_DIR) + set(MS2_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/mediastreamer2) +endif() +if(NOT MS2_INCLUDE_DIR) + set(MS2_INCLUDE_DIR ${MS2_ROOT_DIR}/include) +endif() +if(NOT LIBXML2_ROOT_DIR) + set(LIBXML2_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../libxml2) +endif() +if(NOT LIBXML2_INCLUDE_DIR) + set(LIBXML2_INCLUDE_DIR ${LIBXML2_ROOT_DIR}/include) +endif() +if(NOT BELLESIP_ROOT_DIR) + set(BELLESIP_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../belle-sip) +endif() +if(NOT BELLESIP_INCLUDE_DIR) + set(BELLESIP_INCLUDE_DIR ${BELLESIP_ROOT_DIR}/include) +endif() + +include_directories( + include/ + coreapi/ + ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/libxml2/ +) + +if(USE_INSTALLED_COMPONENTS) + include_directories( + ${CMAKE_INSTALL_PREFIX}/include + ${CMAKE_INSTALL_PREFIX}/include/libxml2 + ) +else() + include_directories( + ${ORTP_INCLUDE_DIR} + ${MS2_INCLUDE_DIR} + ${LIBXML2_INCLUDE_DIR} + ${BELLESIP_INCLUDE_DIR} + ) + if(WIN32) + include_directories(${ORTP_ROOT_DIR}/build/vsx/oRTP/oRTP/) + endif(WIN32) +endif() + +add_subdirectory(coreapi) +add_subdirectory(share) + +if(INSTALL_COMPONENT_IN_POSTBUILD) + add_install_target(INSTALL_liblinphone COMP_liblinphone liblinphone) +endif() diff --git a/coreapi/CMakeLists.txt b/coreapi/CMakeLists.txt new file mode 100644 index 000000000..a007317c5 --- /dev/null +++ b/coreapi/CMakeLists.txt @@ -0,0 +1,99 @@ +set(SOURCE_FILES + address.c + authentication.c + bellesip_sal/sal_address_impl.c + bellesip_sal/sal_impl.c + bellesip_sal/sal_op_call.c + bellesip_sal/sal_op_call_transfer.c + bellesip_sal/sal_op_events.c + bellesip_sal/sal_op_impl.c + bellesip_sal/sal_op_info.c + bellesip_sal/sal_op_message.c + bellesip_sal/sal_op_presence.c + bellesip_sal/sal_op_publish.c + bellesip_sal/sal_op_registration.c + bellesip_sal/sal_sdp.c + callbacks.c + chat.c + conference.c + ec-calibrator.c + enum.c + event.c + friend.c + info.c + linphonecall.c + linphonecore.c + #linphone_tunnel.cc + linphone_tunnel_stubs.c + linphone_tunnel_config.c + lpconfig.c + lsd.c + message_storage.c + misc.c + offeranswer.c + presence.c + proxy.c + sal.c + siplogin.c + sipsetup.c + #TunnelManager.cc + bellesip_sal/sal_impl.h + enum.h + event.h + linphonecore.h + linphonecore_utils.h + linphonefriend.h + linphone_tunnel.h + lpconfig.h + offeranswer.h + private.h + sipsetup.h +) + +add_definitions( + -D_TRUE_TIME + -DIN_LINPHONE + -DUSE_BELLESIP + #-DTUNNEL_ENABLED + #-DVIDEO_ENABLED + -DLINPHONE_PACKAGE_NAME="linphone" + -DLINPHONE_VERSION="Devel" + -DLIBLINPHONE_EXPORTS + -DLINPHONE_PLUGINS_DIR="" +) + +if(WIN32) +add_definitions( + -DWINDOW_NATIVE +) + +set(LIBS ws2_32) +endif(WIN32) +set(LIBS ${LIBS} libortp libmediastreamer_base libmediastreamer_voip libbellesip libxml2) + +add_library(liblinphone SHARED ${SOURCE_FILES}) +set_target_properties(liblinphone PROPERTIES VERSION 3.6.99 SOVERSION 5) + +target_link_libraries(liblinphone ${LIBS}) + +install(TARGETS liblinphone + COMPONENT COMP_liblinphone + 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(liblinphone + INSTALL_libortp + INSTALL_libmediastreamer2 + INSTALL_libbellesip + INSTALL_libxml2) +endif() + + + +file(GLOB HEADER_FILES "*.h") + +install(FILES ${HEADER_FILES} + COMPONENT COMP_liblinphone + DESTINATION include/linphone + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) diff --git a/share/CMakeLists.txt b/share/CMakeLists.txt new file mode 100644 index 000000000..8d15a6f5c --- /dev/null +++ b/share/CMakeLists.txt @@ -0,0 +1,17 @@ +install(FILES archived-rootca.pem + RENAME rootca.pem + COMPONENT COMP_liblinphone + DESTINATION share/linphone + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) + +install(FILES ringback.wav + COMPONENT COMP_liblinphone + DESTINATION share/sounds/linphone + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) + +add_subdirectory(rings) + +install(FILES ../mediastreamer2/src/voip/nowebcamCIF.jpg + COMPONENT COMP_liblinphone + DESTINATION share/images + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) diff --git a/share/rings/CMakeLists.txt b/share/rings/CMakeLists.txt new file mode 100644 index 000000000..cf359bb4e --- /dev/null +++ b/share/rings/CMakeLists.txt @@ -0,0 +1,4 @@ +install(FILES oldphone.wav toy-mono.wav + COMPONENT COMP_liblinphone + DESTINATION share/sounds/linphone/rings + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)