Commit 19538de2 authored by Ghislain MARY's avatar Ghislain MARY

Fix default linking type, conflicting options detection and linphone source...

Fix default linking type, conflicting options detection and linphone source directory for Python module building.
parent 002db87d
......@@ -82,6 +82,11 @@ else()
linphone_builder_add_dummy_libraries_generation()
if(LINPHONE_BUILDER_ADDITIONAL_CONFIG_STEPS)
include(${LINPHONE_BUILDER_ADDITIONAL_CONFIG_STEPS})
endif()
# Give a feature summary
feature_summary(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:")
feature_summary(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:")
......
......@@ -25,7 +25,7 @@ set(EP_antlr3c_GIT_TAG_LATEST "linphone" CACHE STRING "antlr3c tag to use when c
set(EP_antlr3c_GIT_TAG "52075ffb35975c6901e924b4a763b6fb23abd623" CACHE STRING "antlr3c tag to use")
set(EP_antlr3c_EXTERNAL_SOURCE_PATHS "antlr3c" "antlr3" "externals/antlr3")
set(EP_antlr3c_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_antlr3c_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
if(MSVC)
set(EP_antlr3c_EXTRA_LDFLAGS "/SAFESEH:NO")
endif()
......
......@@ -26,5 +26,5 @@ set(EP_bcg729_GIT_TAG "1.0.1" CACHE STRING "bcg729 tag to use")
set(EP_bcg729_EXTERNAL_SOURCE_PATHS "bcg729")
set(EP_bcg729_GROUPABLE YES)
set(EP_bcg729_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_bcg729_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
set(EP_bcg729_DEPENDENCIES EP_ms2)
......@@ -26,7 +26,7 @@ set(EP_bctoolbox_GIT_TAG "master" CACHE STRING "bctoolbox tag to use")
set(EP_bctoolbox_EXTERNAL_SOURCE_PATHS "bctoolbox")
set(EP_bctoolbox_GROUPABLE YES)
set(EP_bctoolbox_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_bctoolbox_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
set(EP_bctoolbox_DEPENDENCIES )
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES)
if (ENABLE_MBEDTLS)
......
......@@ -30,7 +30,7 @@ if(EP_belcard_FORCE_AUTOTOOLS)
set(EP_belcard_LINKING_TYPE "--enable-static")
set(EP_belcard_USE_AUTOGEN True)
else()
set(EP_belcard_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_belcard_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
endif()
if(MSVC)
set(EP_belcard_EXTRA_LDFLAGS "/SAFESEH:NO")
......
......@@ -26,7 +26,7 @@ set(EP_bellesip_GIT_TAG "1.4.2" CACHE STRING "bellesip tag to use")
set(EP_bellesip_EXTERNAL_SOURCE_PATHS "belle-sip")
set(EP_bellesip_GROUPABLE YES)
set(EP_bellesip_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_bellesip_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
set(EP_bellesip_DEPENDENCIES EP_bctoolbox)
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES)
......
......@@ -29,7 +29,7 @@ if(EP_belr_FORCE_AUTOTOOLS)
set(EP_belr_LINKING_TYPE "--enable-static")
set(EP_belr_USE_AUTOGEN True)
else()
set(EP_belr_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_belr_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
endif()
if(MSVC)
set(EP_belr_EXTRA_LDFLAGS "/SAFESEH:NO")
......
......@@ -26,7 +26,7 @@ set(EP_bzrtp_GIT_TAG "1.0.3" CACHE STRING "bzrtp tag to use")
set(EP_bzrtp_EXTERNAL_SOURCE_PATHS "bzrtp")
set(EP_bzrtp_GROUPABLE YES)
set(EP_bzrtp_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_bzrtp_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
set(EP_bzrtp_DEPENDENCIES EP_bctoolbox)
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES AND NOT IOS)
# Do not build xml2 on IOS, it is provided by the system
......
......@@ -25,7 +25,7 @@ set(EP_cunit_GIT_TAG_LATEST "linphone" CACHE STRING "cunit tag to use when compi
set(EP_cunit_GIT_TAG "0a0a9c60f5a1b899ae26b705fa5224ef25377982" CACHE STRING "cunit tag to use")
set(EP_cunit_EXTERNAL_SOURCE_PATHS "cunit" "externals/cunit")
set(EP_cunit_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_cunit_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
if(MSVC)
set(EP_cunit_EXTRA_LDFLAGS "/SAFESEH:NO")
endif()
......
......@@ -30,7 +30,7 @@ if(EP_flexisip_FORCE_AUTOTOOLS)
set(EP_flexisip_LINKING_TYPE "--disable-static" "--enable-shared")
set(EP_flexisip_BUILD_METHOD "autotools")
else()
set(EP_flexisip_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_flexisip_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
endif()
set(EP_flexisip_USE_AUTOGEN True)
set(EP_flexisip_CONFIGURE_OPTIONS )
......
......@@ -25,7 +25,7 @@ set(EP_gsm_GIT_TAG_LATEST "linphone" CACHE STRING "gsm tag to use when compiling
set(EP_gsm_GIT_TAG "0f8822b5326c76bb9dc4c6b552631f51792c3982" CACHE STRING "gsm tag to use")
set(EP_gsm_EXTERNAL_SOURCE_PATHS "gsm" "externals/gsm")
set(EP_gsm_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_gsm_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
if(MSVC)
set(EP_gsm_EXTRA_LDFLAGS "/SAFESEH:NO")
endif()
......@@ -26,7 +26,7 @@ set(EP_linphone_GIT_TAG "3.9.0" CACHE STRING "linphone tag to use")
set(EP_linphone_EXTERNAL_SOURCE_PATHS "linphone")
set(EP_linphone_GROUPABLE YES)
set(EP_linphone_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_linphone_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
set(EP_linphone_DEPENDENCIES EP_bctoolbox EP_bellesip EP_ortp EP_ms2)
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES AND NOT IOS)
# Do not build sqlite3, xml2 and zlib on IOS, they are provided by the system
......
......@@ -24,3 +24,5 @@ set(EP_matroska2_GIT_REPOSITORY "git://git.linphone.org/libmatroska-c.git" CACHE
set(EP_matroska2_GIT_TAG_LATEST "bc" CACHE STRING "matroska2 tag to use when compiling latest version")
set(EP_matroska2_GIT_TAG "c3fc2746f18bafefe3010669d8d2855240565c86" CACHE STRING "matroska2 tag to use")
set(EP_matroska2_EXTERNAL_SOURCE_PATHS "externals/libmatroska-c")
set(EP_matroska2_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
......@@ -23,7 +23,7 @@
set(EP_mbedtls_EXTERNAL_SOURCE_PATHS "mbedtls" "externals/mbedtls")
set(EP_mbedtls_LINKING_TYPE "-DUSE_SHARED_MBEDTLS_LIBRARY=On")
#set(EP_mbedtls_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
#set(EP_mbedtls_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
if(MSVC)
set(EP_mbedtls_EXTRA_LDFLAGS "/SAFESEH:NO")
endif()
......
......@@ -26,7 +26,7 @@ set(EP_ms2_GIT_TAG "2.12.0" CACHE STRING "ms2 tag to use")
set(EP_ms2_EXTERNAL_SOURCE_PATHS "mediastreamer2" "linphone/mediastreamer2")
set(EP_ms2_GROUPABLE YES)
set(EP_ms2_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_ms2_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
set(EP_ms2_DEPENDENCIES EP_ortp EP_bctoolbox)
if(MSVC)
set(EP_ms2_EXTRA_LDFLAGS "/SAFESEH:NO")
......
......@@ -26,7 +26,7 @@ set(EP_msamr_GIT_TAG "1.0.2" CACHE STRING "msamr tag to use")
set(EP_msamr_EXTERNAL_SOURCE_PATHS "msamr")
set(EP_msamr_GROUPABLE YES)
set(EP_msamr_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_msamr_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
set(EP_msamr_DEPENDENCIES EP_ms2 EP_opencoreamr)
set(EP_msamr_CMAKE_OPTIONS "-DENABLE_NARROWBAND=${ENABLE_AMRNB}")
......
......@@ -26,7 +26,7 @@ set(EP_msopenh264_GIT_TAG "1.1.1" CACHE STRING "msopenh264 tag to use")
set(EP_msopenh264_EXTERNAL_SOURCE_PATHS "msopenh264")
set(EP_msopenh264_GROUPABLE YES)
set(EP_msopenh264_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_msopenh264_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
set(EP_msopenh264_DEPENDENCIES EP_ms2 EP_openh264)
if(MSVC)
set(EP_msopenh264_EXTRA_LDFLAGS "/SAFESEH:NO")
......
......@@ -26,5 +26,5 @@ set(EP_mssilk_GIT_TAG "1.0.2" CACHE STRING "mssilk tag to use")
set(EP_mssilk_EXTERNAL_SOURCE_PATHS "mssilk")
set(EP_mssilk_GROUPABLE YES)
set(EP_mssilk_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_mssilk_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
set(EP_mssilk_DEPENDENCIES EP_ms2)
......@@ -26,6 +26,6 @@ set(EP_mswasapi_GIT_TAG "1.0.0" CACHE STRING "mswasapi tag to use")
set(EP_mswasapi_EXTERNAL_SOURCE_PATHS "mswasapi")
set(EP_mswasapi_GROUPABLE YES)
set(EP_mswasapi_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_mswasapi_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
set(EP_mswasapi_EXTRA_LDFLAGS "/SAFESEH:NO")
set(EP_mswasapi_DEPENDENCIES EP_ms2)
......@@ -26,7 +26,7 @@ set(EP_mswebrtc_GIT_TAG "88c0fa6ae7ea35fa25eac5ce4b50898e85443ff0" CACHE STRING
set(EP_mswebrtc_EXTERNAL_SOURCE_PATHS "mswebrtc")
set(EP_mswebrtc_GROUPABLE YES)
set(EP_mswebrtc_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_mswebrtc_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
set(EP_mswebrtc_DEPENDENCIES EP_ms2)
set(EP_mswebrtc_CMAKE_OPTIONS
......
......@@ -26,5 +26,5 @@ set(EP_mswinrtvid_GIT_TAG "b067bca955dc170b54fffe019a6a7ce86c781c8a" CACHE STRIN
set(EP_mswinrtvid_EXTERNAL_SOURCE_PATHS "mswinrtvid")
set(EP_mswinrtvid_GROUPABLE YES)
set(EP_mswinrtvid_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_mswinrtvid_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
set(EP_mswinrtvid_DEPENDENCIES EP_ms2)
......@@ -25,5 +25,5 @@ set(EP_mswp8vid_GIT_TAG_LATEST "master" CACHE STRING "mswp8vid tag to use when c
set(EP_mswp8vid_GIT_TAG "0c28ede7baa26081ed13f93f5ede4ec61b5a263b" CACHE STRING "mswp8vid tag to use")
set(EP_mswp8vid_EXTERNAL_SOURCE_PATHS "mswp8vid")
set(EP_mswp8vid_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_mswp8vid_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
set(EP_mswp8vid_DEPENDENCIES EP_ms2)
......@@ -26,5 +26,5 @@ set(EP_msx264_GIT_TAG "3a9b5a9ff79ea45b9f8f03d03d4a4a9213dc2c5d" CACHE STRING "m
set(EP_msx264_EXTERNAL_SOURCE_PATHS "msx264")
set(EP_msx264_GROUPABLE YES)
set(EP_msx264_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_msx264_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
set(EP_msx264_DEPENDENCIES EP_ms2 EP_x264)
......@@ -39,5 +39,5 @@ else()
set(EP_opus_PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/opus/CMakeLists.txt" "<SOURCE_DIR>")
list(APPEND EP_opus_PATCH_COMMAND "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/opus/config.h.cmake" "<SOURCE_DIR>")
set(EP_opus_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_opus_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
endif()
......@@ -30,7 +30,7 @@ if(EP_ortp_FORCE_AUTOTOOLS)
set(EP_ortp_LINKING_TYPE "--enable-static")
set(EP_ortp_USE_AUTOGEN True)
else()
set(EP_ortp_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_ortp_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
endif()
if(MSVC)
set(EP_ortp_EXTRA_LDFLAGS "/SAFESEH:NO")
......
......@@ -25,7 +25,7 @@ set(EP_speex_GIT_TAG_LATEST "linphone" CACHE STRING "speex tag to use when compi
set(EP_speex_GIT_TAG "caeb73052b1171758acb565e7174a49fbd1427d2" CACHE STRING "speex tag to use")
set(EP_speex_EXTERNAL_SOURCE_PATHS "speex" "externals/speex")
set(EP_speex_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_speex_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
if(MSVC)
set(EP_speex_EXTRA_LDFLAGS "/SAFESEH:NO")
endif()
......@@ -27,4 +27,4 @@ set(EP_sqlite3_PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOU
if(WIN32)
list(APPEND EP_sqlite3_PATCH_COMMAND "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/sqlite3/sqlite3.def" "<SOURCE_DIR>")
endif()
set(EP_sqlite3_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_sqlite3_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
......@@ -25,7 +25,7 @@ set(EP_srtp_GIT_TAG_LATEST "master" CACHE STRING "srtp tag to use when compiling
set(EP_srtp_GIT_TAG "befc23777e07efba36ffd7bda73f22c92d4e2475" CACHE STRING "srtp tag to use")
set(EP_srtp_EXTERNAL_SOURCE_PATHS "srtp" "externals/srtp")
set(EP_srtp_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_srtp_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
if(MSVC)
set(EP_srtp_EXTRA_LDFLAGS "/SAFESEH:NO")
endif()
......@@ -26,7 +26,7 @@ set(EP_tunnel_GIT_TAG "94150ed5ffda2c07407e68a9bbd3ccb985600d34" CACHE STRING "t
set(EP_tunnel_EXTERNAL_SOURCE_PATHS "tunnel")
set(EP_tunnel_GROUPABLE YES)
set(EP_tunnel_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_tunnel_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
set(EP_tunnel_DEPENDENCIES )
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES)
list(APPEND EP_tunnel_DEPENDENCIES EP_polarssl)
......
......@@ -37,7 +37,7 @@ else()
set(EP_xml2_GIT_TAG "v2.8.0" CACHE STRING "xml2 tag to use")
set(EP_xml2_EXTERNAL_SOURCE_PATHS "libxml2" "xml2" "externals/libxml2")
set(EP_xml2_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_xml2_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
set(EP_xml2_PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/xml2/CMakeLists.txt" "<SOURCE_DIR>")
list(APPEND EP_xml2_PATCH_COMMAND "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/xml2/config.h.cmake" "<SOURCE_DIR>")
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
......
......@@ -141,7 +141,7 @@ if(CMAKE_TOOLCHAIN_FILE)
endif()
function(linphone_builder_get_autotools_configuration)
macro(linphone_builder_get_autotools_configuration)
if(MSVC)
set(_generator "MinGW Makefiles")
else()
......@@ -175,7 +175,7 @@ function(linphone_builder_get_autotools_configuration)
unset(_extra_generator)
unset(_generator)
include(${CMAKE_BINARY_DIR}/Autotools/Autotools.cmake)
endfunction()
endmacro()
macro(linphone_builder_create_targets_list)
......@@ -462,9 +462,9 @@ macro(linphone_builder_create_build_command PROJNAME)
endmacro()
# this function invokes configure_file() for the project, using the default file if
# this macro invokes configure_file() for the project, using the default file if
# the specific file is not defined
function(linphone_builder_configure_file_for_project PROJNAME CMD DEFAULT_CONF_FILE OUTPUT)
macro(linphone_builder_configure_file_for_project PROJNAME CMD DEFAULT_CONF_FILE OUTPUT)
if(NOT EP_${PROJNAME}_${CMD}_COMMAND_SOURCE)
message(STATUS "Using default file ${DEFAULT_CONF_FILE} for ${CMD} step of ${PROJNAME}")
configure_file(${DEFAULT_CONF_FILE} ${OUTPUT})
......@@ -472,7 +472,7 @@ function(linphone_builder_configure_file_for_project PROJNAME CMD DEFAULT_CONF_F
message(STATUS "Using specific file ${EP_${PROJNAME}_${CMD}_COMMAND_SOURCE} for ${CMD} step of ${PROJNAME}")
configure_file(${EP_${PROJNAME}_${CMD}_COMMAND_SOURCE} ${OUTPUT})
endif()
endfunction()
endmacro()
macro(linphone_builder_filter_out_inexistent_dependencies PROJNAME)
if(EP_${PROJNAME}_DEPENDENCIES)
......@@ -494,7 +494,7 @@ macro(linphone_builder_filter_out_inexistent_dependencies PROJNAME)
endif()
endmacro()
function(linphone_builder_add_external_project PROJNAME)
macro(linphone_builder_add_external_project PROJNAME)
if(LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH)
foreach(SUBDIR ${EP_${PROJNAME}_EXTERNAL_SOURCE_PATHS})
if(NOT EP_${PROJNAME}_SOURCE_DIR)
......@@ -724,12 +724,12 @@ function(linphone_builder_add_external_project PROJNAME)
linphone_builder_restore_flags()
endfunction()
endmacro()
macro(linphone_builder_add_grouped_external_source_path_project PROJNAME FILENAME)
linphone_builder_filter_out_inexistent_dependencies(${PROJNAME})
file(APPEND "${FILENAME}" "add_subdirectory(\"${EP_${PROJNAME}_SOURCE_DIR}\" \"${LINPHONE_BUILDER_WORK_DIR}/Build/${PROJNAME}\")\n")
list(APPEND EP_linphone_builder_LINKING_TYPES "${EP_${PROJNAME}_LINKING_TYPE}")
list(APPEND EP_linphone_builder_LINKING_TYPE "${EP_${PROJNAME}_LINKING_TYPE}")
list(APPEND EP_linphone_builder_CMAKE_OPTIONS "${EP_${PROJNAME}_CMAKE_OPTIONS}")
list(APPEND EP_linphone_builder_EXTRA_CFLAGS "${EP_${PROJNAME}_EXTRA_CFLAGS}")
list(APPEND EP_linphone_builder_EXTRA_CPPFLAGS "${EP_${PROJNAME}_EXTRA_CPPFLAGS}")
......@@ -743,7 +743,7 @@ macro(linphone_builder_add_grouped_external_source_path_project PROJNAME FILENAM
endif()
endmacro()
function(linphone_builder_add_external_projects)
macro(linphone_builder_add_external_projects)
foreach(BUILDER ${LINPHONE_BUILDER_INCLUDED_BUILDERS})
list(FIND LINPHONE_BUILDER_INCLUDED_BUILDERS_TO_EXCLUDE ${BUILDER} _excluded_found)
list(FIND LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH_BUILDERS ${BUILDER} _external_source_path_found)
......@@ -751,24 +751,25 @@ function(linphone_builder_add_external_projects)
linphone_builder_add_external_project(${BUILDER})
endif()
endforeach()
endfunction()
endmacro()
macro(detect_conflicting_cmake_options)
if(EP_linphone_builder_CMAKE_OPTIONS)
list(REMOVE_DUPLICATES EP_linphone_builder_CMAKE_OPTIONS)
macro(detect_variable_conflict VARIABLE_NAME ERROR_MESSAGE)
if(EP_linphone_builder_${VARIABLE_NAME})
list(REMOVE_DUPLICATES EP_linphone_builder_${VARIABLE_NAME})
set(_new_options )
foreach(_option ${EP_linphone_builder_CMAKE_OPTIONS})
foreach(_option ${EP_linphone_builder_${VARIABLE_NAME}})
string(REGEX MATCH "^-D(.+)=(.*)$" _match "${_option}")
if(_match)
set(_new_option "-D${CMAKE_MATCH_1}=")
set(_varname ${CMAKE_MATCH_1})
set(_value ${CMAKE_MATCH_2})
if(CMAKE_MATCH_1 MATCHES "^ENABLE_.*$")
if(_varname MATCHES "^ENABLE_.*$")
if(_value)
set(_new_option "${_new_option}ON")
set(_conflicting_option "${_new_option}OFF")
set(_new_option "${_new_option}ON")
else()
set(_new_option "${_new_option}OFF")
set(_conflicting_option "${_new_option}ON")
set(_new_option "${_new_option}OFF")
endif()
else()
set(_new_option "${_new_option}${_value}")
......@@ -779,17 +780,25 @@ macro(detect_conflicting_cmake_options)
list(APPEND _new_options "${_new_option}")
endif()
if(_conflict_found GREATER -1)
message(FATAL_ERROR "Conflicting options ${_new_option} and ${_conflicting_option}")
message(FATAL_ERROR ${ERROR_MESSAGE})
endif()
endif()
endforeach()
if(_new_options)
set(EP_linphone_builder_CMAKE_OPTIONS ${_new_options})
set(EP_linphone_builder_${VARIABLE_NAME} ${_new_options})
endif()
endif()
endmacro()
function(linphone_builder_add_grouped_external_source_path_projects)
macro(detect_conflicting_cmake_options)
detect_variable_conflict(CMAKE_OPTIONS "Conflicting options \${_new_option} and \${_conflicting_option}")
endmacro()
macro(detect_conflicting_linking_types)
detect_variable_conflict(LINKING_TYPE "Conflicing linking types in grouped external source path projects: \${EP_linphone_builder_LINKING_TYPE}")
endmacro()
macro(linphone_builder_add_grouped_external_source_path_projects)
set(_grouped_builders)
if(LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH_BUILDERS)
foreach (_builder ${LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH_BUILDERS})
......@@ -805,7 +814,7 @@ function(linphone_builder_add_grouped_external_source_path_projects)
file(APPEND "${_linphone_builder_file}" "project(EP_linphone_builder)\n")
file(APPEND "${_linphone_builder_file}" "option(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS \"Group external source path builders.\" ON)\n")
set(EP_linphone_builder_CMAKE_OPTIONS )
set(EP_linphone_builder_LINKING_TYPES )
set(EP_linphone_builder_LINKING_TYPE )
set(EP_linphone_builder_EXTRA_CFLAGS )
set(EP_linphone_builder_EXTRA_CPPFLAGS )
set(EP_linphone_builder_EXTRA_CXXFLAGS )
......@@ -817,13 +826,7 @@ function(linphone_builder_add_grouped_external_source_path_projects)
list(APPEND EP_linphone_builder_GROUPED_SOURCE_DIRS ${EP_${BUILDER}_SOURCE_DIR})
linphone_builder_add_grouped_external_source_path_project(${BUILDER} "${_linphone_builder_file}")
endforeach()
list(REMOVE_DUPLICATES EP_linphone_builder_LINKING_TYPES)
list(LENGTH EP_linphone_builder_LINKING_TYPES _conflicting_linking_types)
if(_conflicting_linking_types GREATER 1)
message(FATAL_ERROR "Conflicing linking types in grouped external source path projects: ${EP_linphone_builder_LINKING_TYPES}")
else()
set(EP_linphone_builder_LINKING_TYPE ${EP_linphone_builder_LINKING_TYPES})
endif()
detect_conflicting_linking_types()
detect_conflicting_cmake_options()
if(EP_linphone_builder_EXTRA_CFLAGS)
list(REMOVE_DUPLICATES EP_linphone_builder_EXTRA_CFLAGS)
......@@ -850,12 +853,12 @@ function(linphone_builder_add_grouped_external_source_path_projects)
unset(_linphone_builder_file)
unset(_grouped_builders)
endif()
endfunction()
endmacro()
function(linphone_builder_add_projects)
macro(linphone_builder_add_projects)
linphone_builder_add_external_projects()
linphone_builder_add_grouped_external_source_path_projects()
endfunction()
endmacro()
macro(linphone_builder_add_dummy_libraries_generation)
if(LINPHONE_BUILDER_DUMMY_LIBRARIES)
......
......@@ -32,8 +32,9 @@ set(DEFAULT_VALUE_ENABLE_VIDEO ON)
set(DEFAULT_VALUE_ENABLE_VPX ON)
set(DEFAULT_VALUE_ENABLE_WASAPI ON)
set(DEFAULT_VALUE_ENABLE_ZRTP ON)
set(ENABLE_NLS NO CACHE BOOL "" FORCE)
set(DEFAULT_VALUE_CMAKE_LINKING_TYPE "-DENABLE_STATIC=YES")
set(DEFAULT_VALUE_CMAKE_LINKING_TYPE "-DENABLE_STATIC=YES" "-DENABLE_SHARED=NO")
find_package(Doxygen REQUIRED)
......@@ -84,7 +85,6 @@ list(APPEND EP_linphone_CMAKE_OPTIONS
"-DENABLE_TUTORIALS=NO"
"-DENABLE_UNIT_TESTS=NO"
"-DENABLE_UPNP=NO"
"-DENABLE_NLS=NO"
)
# ms2
......@@ -115,20 +115,5 @@ set(EP_v4l_LINKING_TYPE "--enable-static" "--disable-shared" "--with-pic")
set(EP_vpx_LINKING_TYPE "--enable-static" "--disable-shared" "--enable-pic")
# Python module
if(NOT PACKAGE_NAME)
set(PACKAGE_NAME "linphone")
endif()
linphone_builder_apply_flags()
linphone_builder_set_ep_directories(pylinphone)
linphone_builder_expand_external_project_vars()
ExternalProject_Add(TARGET_pylinphone
DEPENDS TARGET_linphone_builder
TMP_DIR ${ep_tmp}
BINARY_DIR ${ep_build}
DOWNLOAD_COMMAND ""
PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy_directory" "${CMAKE_CURRENT_LIST_DIR}/python" "<SOURCE_DIR>"
"COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_LIST_DIR}/../cmake/FindXML2.cmake" "<SOURCE_DIR>"
CMAKE_GENERATOR ${CMAKE_GENERATOR}
CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DPACKAGE_NAME=${PACKAGE_NAME} -DLINPHONE_SOURCE_DIR=${EP_linphone_SOURCE_DIR} -DENABLE_FFMPEG:BOOL=${ENABLE_FFMPEG} -DENABLE_OPENH264:BOOL=${ENABLE_OPENH264} -DENABLE_WASAPI:BOOL=${ENABLE_WASAPI}
)
# Add config step to build the Python module
set(LINPHONE_BUILDER_ADDITIONAL_CONFIG_STEPS "${CMAKE_CURRENT_LIST_DIR}/python/additional_steps.cmake")
############################################################################
# config-python.cmake
# Copyright (C) 2016 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
# Add external project to build the Python module
if(NOT PACKAGE_NAME)
set(PACKAGE_NAME "linphone")
endif()
linphone_builder_apply_flags()
linphone_builder_set_ep_directories(pylinphone)
linphone_builder_expand_external_project_vars()
ExternalProject_Add(TARGET_pylinphone
DEPENDS TARGET_linphone_builder
TMP_DIR ${ep_tmp}
BINARY_DIR ${ep_build}
DOWNLOAD_COMMAND ""
PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy_directory" "${CMAKE_CURRENT_LIST_DIR}" "<SOURCE_DIR>"
"COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_LIST_DIR}/../../cmake/FindXML2.cmake" "<SOURCE_DIR>"
CMAKE_GENERATOR ${CMAKE_GENERATOR}
CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} -DPACKAGE_NAME=${PACKAGE_NAME} -DLINPHONE_SOURCE_DIR=${EP_linphone_SOURCE_DIR} -DENABLE_FFMPEG:BOOL=${ENABLE_FFMPEG} -DENABLE_OPENH264:BOOL=${ENABLE_OPENH264} -DENABLE_WASAPI:BOOL=${ENABLE_WASAPI}
)
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