Commit cb4de781 authored by Ghislain MARY's avatar Ghislain MARY

Use generic and configurable list of files to include in the SDK.

parent 0b957246
......@@ -165,6 +165,14 @@ endif()
# Packaging
if(ENABLE_PACKAGING)
get_cmake_property(_varnames VARIABLES)
set(ENABLE_VARIABLES )
foreach(_varname ${_varnames})
if(_varname MATCHES "^ENABLE_.*")
list(APPEND ENABLE_VARIABLES -D${_varname}=${${_varname}})
endif()
endforeach()
if(LINPHONE_BUILDER_TARGET STREQUAL linphone)
# Linphone and linphone SDK packages
linphone_builder_apply_flags()
......@@ -177,7 +185,7 @@ if(ENABLE_PACKAGING)
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/desktop/linphone_package"
DOWNLOAD_COMMAND ""
CMAKE_GENERATOR ${CMAKE_GENERATOR}
CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DCMAKE_INSTALL_PREFIX=${LINPHONE_BUILDER_WORK_DIR}/PACKAGE -DTOOLS_DIR=${CMAKE_BINARY_DIR}/programs -DLINPHONE_OUTPUT_DIR=${CMAKE_INSTALL_PREFIX} -DLINPHONE_SOURCE_DIR=${EP_linphone_SOURCE_DIR} -DENABLE_ZRTP:BOOL=${ENABLE_ZRTP} -DENABLE_OPENH264:BOOL=${ENABLE_OPENH264} -DOPENH264_VERSION=${EP_openh264_VERSION}
CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DCMAKE_INSTALL_PREFIX=${LINPHONE_BUILDER_WORK_DIR}/PACKAGE -DTOOLS_DIR=${CMAKE_BINARY_DIR}/programs -DLINPHONE_OUTPUT_DIR=${CMAKE_INSTALL_PREFIX} -DLINPHONE_SOURCE_DIR=${EP_linphone_SOURCE_DIR} ${ENABLE_VARIABLES} -DOPENH264_VERSION=${EP_openh264_VERSION}
)
elseif((LINPHONE_BUILDER_TARGET STREQUAL ms2) OR (LINPHONE_BUILDER_TARGET STREQUAL ms2-plugins))
# Mediastreamer SDK packages
......@@ -191,7 +199,7 @@ if(ENABLE_PACKAGING)
SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/desktop/ms2_package"
DOWNLOAD_COMMAND ""
CMAKE_GENERATOR ${CMAKE_GENERATOR}
CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DCMAKE_INSTALL_PREFIX=${LINPHONE_BUILDER_WORK_DIR}/PACKAGE -DLINPHONE_OUTPUT_DIR=${CMAKE_INSTALL_PREFIX} -DMS2_SOURCE_DIR=${EP_ms2_SOURCE_DIR} -DENABLE_ZRTP:BOOL=${ENABLE_ZRTP}
CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DCMAKE_INSTALL_PREFIX=${LINPHONE_BUILDER_WORK_DIR}/PACKAGE -DLINPHONE_OUTPUT_DIR=${CMAKE_INSTALL_PREFIX} -DMS2_SOURCE_DIR=${EP_ms2_SOURCE_DIR} ${ENABLE_VARIABLES}
)
endif()
endif()
......@@ -44,11 +44,11 @@ list(GET SPLITTED_LINPHONE_VERSION 2 LINPHONE_MICRO_VERSION)
set(PACKAGE_VERSION "${LINPHONE_VERSION}")
# Preparing the Linphone SDK bundle
set(LINPHONE_SDK_TMP "${CMAKE_CURRENT_BINARY_DIR}/linphone-sdk-tmp")
file(REMOVE_RECURSE "${LINPHONE_SDK_TMP}")
file(COPY "${LINPHONE_OUTPUT_DIR}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
file(RENAME "${CMAKE_CURRENT_BINARY_DIR}/OUTPUT" "${LINPHONE_SDK_TMP}")
if(APPLE)
set(LINPHONE_SDK_TMP "${CMAKE_CURRENT_BINARY_DIR}/linphone-sdk-tmp")
file(REMOVE_RECURSE "${LINPHONE_SDK_TMP}")
file(COPY "${LINPHONE_OUTPUT_DIR}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")
file(RENAME "${CMAKE_CURRENT_BINARY_DIR}/OUTPUT" "${LINPHONE_SDK_TMP}")
set(RPATH_CHANGE_CMDS
-change /opt/local/lib/libintl.8.dylib @rpath/libintl.8.dylib
-change /opt/local/lib/libiconv.2.dylib @rpath/libiconv.2.dylib
......@@ -74,31 +74,93 @@ if(APPLE)
-change /opt/local/lib/libiconv.2.dylib @rpath/libiconv.2.dylib
${LINPHONE_SDK_TMP}/lib/liblinphone.dylib
)
if(ENABLE_OPENH264)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/README.openh264.txt.in" "${LINPHONE_SDK_TMP}/README.openh264.txt" @ONLY)
endif()
endif()
# Generates a zip archive containing the development files of liblinphone
macro(add_list_file NAME)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/sdk_content/${NAME}.list.in" "${LINPHONE_SDK_TMP}/${NAME}.list" @ONLY)
list(APPEND LIST_FILES "${LINPHONE_SDK_TMP}/${NAME}.list")
endmacro()
if(WIN32)
set(LIBDIR "bin")
set(LIBPREFIX "")
set(LIBEXT "dll")
set(PLUGINEXT "dll")
elseif(APPLE)
set(LIBDIR "lib")
set(LIBPREFIX "lib")
set(LIBEXT "dylib")
set(PLUGINEXT "so")
endif()
set(LIST_FILES )
add_list_file(bctoolbox)
add_list_file(antlr3c)
add_list_file(bellesip)
add_list_file(ortp)
add_list_file(ms2)
add_list_file(ms2plugins)
add_list_file(linphone)
if(WIN32)
add_list_file(sqlite3)
add_list_file(xml2)
add_list_file(zlib)
endif()
if(ENABLE_UNIT_TESTS)
add_list_file(cunit)
endif()
if(ENABLE_VCARD)
add_list_file(vcard)
endif()
if(ENABLE_BV16)
add_list_file(bv16)
endif()
if(ENABLE_GSM)
add_list_file(gsm)
endif()
if(ENABLE_OPUS)
add_list_file(opus)
endif()
if(ENABLE_SPEEX)
add_list_file(speex)
endif()
if(ENABLE_MBEDTLS)
add_list_file(mbedtls)
endif()
if(ENABLE_POLARSSL)
add_list_file(polarssl)
endif()
if(ENABLE_SRTP)
add_list_file(srtp)
endif()
if(ENABLE_ZRTP)
add_list_file(bzrtp)
endif()
if(ENABLE_FFMPEG)
add_list_file(ffmpeg)
endif()
if(ENABLE_OPENH264)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/README.openh264.txt.in" "${LINPHONE_SDK_TMP}/README.openh264.txt" @ONLY)
add_list_file(openh264)
endif()
file(WRITE "${LINPHONE_SDK_TMP}/linphone-sdk.list" "")
foreach(_file ${LIST_FILES})
file(READ "${_file}" _content)
file(APPEND "${LINPHONE_SDK_TMP}/linphone-sdk.list" "${_content}\n")
endforeach()
if(WIN32)
find_program(7Z_PROGRAM 7z.exe)
if(7Z_PROGRAM)
execute_process(
COMMAND ${7Z_PROGRAM} a -tzip ${CMAKE_BINARY_DIR}/linphone-sdk-${LINPHONE_GIT_REVISION}-win32.zip @${CMAKE_SOURCE_DIR}/linphone-sdk.list
WORKING_DIRECTORY ${LINPHONE_OUTPUT_DIR}
COMMAND ${7Z_PROGRAM} a -tzip ${CMAKE_BINARY_DIR}/linphone-sdk-${LINPHONE_GIT_REVISION}-win32.zip @linphone-sdk.list
WORKING_DIRECTORY ${LINPHONE_SDK_TMP}
)
if(ENABLE_OPENH264)
execute_process(
COMMAND ${7Z_PROGRAM} a -tzip ${CMAKE_BINARY_DIR}/linphone-sdk-${LINPHONE_GIT_REVISION}-win32.zip ${CMAKE_SOURCE_DIR}/README.openh264.txt
)
endif()
else()
message(WARNING "7z has not been found, cannot generate the SDK!")
endif()
elseif(APPLE)
execute_process(
COMMAND rm -rf "${CMAKE_BINARY_DIR}/linphone-sdk-${LINPHONE_GIT_REVISION}-mac.zip"
COMMAND zip -ry "${CMAKE_BINARY_DIR}/linphone-sdk-${LINPHONE_GIT_REVISION}-mac.zip" . -i "@${CMAKE_SOURCE_DIR}/linphone-sdk-mac.list"
COMMAND zip -ry "${CMAKE_BINARY_DIR}/linphone-sdk-${LINPHONE_GIT_REVISION}-mac.zip" . -i "@linphone-sdk.list"
WORKING_DIRECTORY ${LINPHONE_SDK_TMP}
)
endif()
......
README.openh264.txt
./include/*
./lib/libantlr3c*.dylib
./lib/libavcodec*.dylib
./lib/libavutil*.dylib
./lib/libbctoolbox*.dylib
./lib/libbelcard*.dylib
./lib/libbcg729*.dylib
./lib/libbellesip*.dylib
./lib/libbelr*.dylib
./lib/libbv16*.dylib
./lib/libbzrtp*.dylib
./lib/libcunit*.dylib
./lib/libgsm*.dylib
./lib/libiconv*.dylib
./lib/libintl*.dylib
./lib/liblinphone*.dylib
./lib/libmediastreamer*.dylib
./lib/libopus*.dylib
./lib/libortp*.dylib
./lib/libpolarssl*.dylib
./lib/libspeex*.dylib
./lib/libspeexdsp*.dylib
./lib/libsqlite3*.dylib
./lib/libsrtp*.dylib
./lib/libswresample*.dylib
./lib/libswscale*.dylib
./lib/libxml2*.dylib
./lib/cmake/*
./lib/pkgconfig/*
./lib/mediastreamer/plugins/*.so
./share/images/nowebcamCIF.jpg
./share/sounds/*
./share/locale/*
bin/antlr3c.dll
bin/avcodec-53.dll
bin/avutil-51.dll
bin/bellesip.dll
bin/bzrtp.dll
bin/cunit.dll
bin/gsm.dll
bin/intl.dll
bin/linphone.dll
bin/mediastreamer_base.dll
bin/mediastreamer_voip.dll
bin/opus.dll
bin/ortp.dll
bin/polarssl.dll
bin/speex.dll
bin/speexdsp.dll
bin/sqlite3.dll
bin/srtp.dll
bin/swresample-0.dll
bin/swscale-2.dll
bin/xml2.dll
include/linphone/
include/mediastreamer2/
include/ortp/
lib/cmake/Linphone/
lib/cmake/Mediastreamer2/
lib/cmake/oRTP/
lib/mediastreamer/plugins
lib/linphone.lib
lib/mediastreamer_base.lib
lib/mediastreamer_voip.lib
lib/ortp.lib
lib/pkgconfig/ortp.pc
share/images/nowebcamCIF.jpg
share/sounds/linphone/
@LIBDIR@/@LIBPREFIX@bctoolbox*.@LIBEXT@
include/bctoolbox
lib/bctoolbox*.lib
lib/pkgconfig/bctoolbox*.pc
share/bctoolbox/cmake
@LIBDIR@/@LIBPREFIX@bellesip*.@LIBEXT@
include/belle-sip
lib/bellesip*.lib
lib/pkgconfig/belle-sip.pc
share/BelleSIP/cmake
@LIBDIR@/@LIBPREFIX@bv16*.@LIBEXT@
\ No newline at end of file
@LIBDIR@/@LIBPREFIX@bzrtp*.@LIBEXT@
share/bzrtp/cmake
@LIBDIR@/@LIBPREFIX@cunit*.@LIBEXT@
\ No newline at end of file
@LIBDIR@/@LIBPREFIX@avcodec*.@LIBEXT@
@LIBDIR@/@LIBPREFIX@avutil*.@LIBEXT@
@LIBDIR@/@LIBPREFIX@swscale*.@LIBEXT@
@LIBDIR@/@LIBPREFIX@swresample*.@LIBEXT@
@LIBDIR@/@LIBPREFIX@gsm*.@LIBEXT@
\ No newline at end of file
@LIBDIR@/@LIBPREFIX@linphone*.@LIBEXT@
@LIBDIR@/@LIBPREFIX@iconv*.@LIBEXT@
@LIBDIR@/@LIBPREFIX@intl*.@LIBEXT@
include/linphone
lib/linphone*.lib
share/doc/linphone-*
share/Linphone/cmake
share/sounds/linphone/*
share/locale/*/LC_MESSAGES/linphone.mo
@LIBDIR@/@LIBPREFIX@mbedcrypto*.@LIBEXT@
@LIBDIR@/@LIBPREFIX@mbedx509*.@LIBEXT@
@LIBDIR@/@LIBPREFIX@mbedtls*.@LIBEXT@
@LIBDIR@/@LIBPREFIX@mediastreamer_base*.@LIBEXT@
@LIBDIR@/@LIBPREFIX@mediastreamer_voip*.@LIBEXT@
include/mediastreamer2
lib/mediastreamer_base*.lib
lib/mediastreamer_voip*.lib
share/doc/mediastreamer2-*
share/images/nowebcamCIF.jpg
share/Mediastreamer2/cmake
@LIBDIR@/@LIBPREFIX@opus*.@LIBEXT@
\ No newline at end of file
@LIBDIR@/@LIBPREFIX@ortp*.@LIBEXT@
include/ortp
lib/ortp*.lib
lib/pkgconfig/ortp.pc
share/doc/oRTP-*
share/oRTP/cmake
@LIBDIR@/@LIBPREFIX@speex*.@LIBEXT@
\ No newline at end of file
@LIBDIR@/@LIBPREFIX@srtp*.@LIBEXT@
\ No newline at end of file
@LIBDIR@/@LIBPREFIX@belr*.@LIBEXT@
@LIBDIR@/@LIBPREFIX@belcard*.@LIBEXT@
lib/belr*.lib
lib/belcard*.lib
share/Belr/cmake
share/Belcard/cmake
@LIBDIR@/@LIBPREFIX@xml2*.@LIBEXT@
\ No newline at end of file
@LIBDIR@/@LIBPREFIX@zlib*.@LIBEXT@
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment