Commit 112803c1 authored by Ghislain MARY's avatar Ghislain MARY

Fix 0002981: Add a build parameter in CMake Builder to only build non-external submodules.

Replace LINPHONE_BUILDER_BUILD_ONLY_EXTERNAL_SOURCE_PATH option by LINPHONE_BUILDER_USE_SYSTEM_DEPENDENCIES and declare in each builder if it may be found on the system.
parent 9967c7e6
......@@ -36,7 +36,7 @@ option(LINPHONE_BUILDER_CHECK_LASTEST "Check that the git revisions are the late
option(LINPHONE_BUILDER_BUILD_DEPENDENCIES "Build the dependencies instead of using the system libraries." YES)
set(LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH "" CACHE STRING "External path to source code that is available.")
set(LINPHONE_BUILDER_DUMMY_LIBRARIES "" CACHE STRING "Dummy libraries to be generated.")
option(LINPHONE_BUILDER_BUILD_ONLY_EXTERNAL_SOURCE_PATH "Build only the code put in external source path." NO)
option(LINPHONE_BUILDER_USE_SYSTEM_DEPENDENCIES "Use system dependencies." NO)
option(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS "Group external source path builders in a single external project." NO)
......
......@@ -24,6 +24,7 @@ set(EP_antlr3c_GIT_REPOSITORY "git://git.linphone.org/antlr3.git" CACHE STRING "
set(EP_antlr3c_GIT_TAG_LATEST "linphone" CACHE STRING "antlr3c tag to use when compiling latest version")
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_MAY_BE_FOUND_ON_SYSTEM TRUE)
set(EP_antlr3c_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
if(MSVC)
......
......@@ -44,6 +44,7 @@ else()
set(EP_ffmpeg_GIT_TAG_LATEST "bc" CACHE STRING "ffmpeg tag to use when compiling latest version")
set(EP_ffmpeg_GIT_TAG "51aa587f7ddac63c831d73eb360e246765a2675f" CACHE STRING "ffmpeg tag to use")
set(EP_ffmpeg_EXTERNAL_SOURCE_PATHS "externals/ffmpeg")
set(EP_ffmpeg_MAY_BE_FOUND_ON_SYSTEM TRUE)
set(EP_ffmpeg_BUILD_METHOD "autotools")
set(EP_ffmpeg_CONFIGURE_OPTIONS
"--disable-zlib"
......
......@@ -24,6 +24,7 @@ set(EP_gsm_GIT_REPOSITORY "git://git.linphone.org/gsm.git" CACHE STRING "gsm rep
set(EP_gsm_GIT_TAG_LATEST "linphone" CACHE STRING "gsm tag to use when compiling latest version")
set(EP_gsm_GIT_TAG "0f8822b5326c76bb9dc4c6b552631f51792c3982" CACHE STRING "gsm tag to use")
set(EP_gsm_EXTERNAL_SOURCE_PATHS "gsm" "externals/gsm")
set(EP_gsm_MAY_BE_FOUND_ON_SYSTEM TRUE)
set(EP_gsm_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
if(MSVC)
......
......@@ -24,6 +24,7 @@ set(EP_mbedtls_GIT_REPOSITORY "git://git.linphone.org/mbedtls.git" CACHE STRING
set(EP_mbedtls_GIT_TAG_LATEST "linphone" CACHE STRING "mbedtls tag to use when compiling latest version")
set(EP_mbedtls_GIT_TAG "3b88f2749d59e5346de08e121fba1d797c55ddaa" CACHE STRING "mbedtls tag to use")
set(EP_mbedtls_EXTERNAL_SOURCE_PATHS "mbedtls" "externals/mbedtls")
set(EP_mbedtls_MAY_BE_FOUND_ON_SYSTEM TRUE)
set(EP_mbedtls_LINKING_TYPE "-DUSE_STATIC_MBEDTLS_LIBRARY=NO" "-DUSE_SHARED_MBEDTLS_LIBRARY=YES")
set(EP_mbedtls_CMAKE_OPTIONS "-DENABLE_PROGRAMS=NO" "-DENABLE_TESTING=NO")
......
......@@ -36,6 +36,7 @@ else()
set(EP_opus_URL "http://downloads.xiph.org/releases/opus/opus-1.1.1.tar.gz")
set(EP_opus_URL_HASH "MD5=cfb354d4c65217ca32a762f8ab15f2ac")
set(EP_opus_EXTERNAL_SOURCE_PATHS "opus" "externals/opus")
set(EP_opus_MAY_BE_FOUND_ON_SYSTEM TRUE)
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>")
......
......@@ -24,6 +24,7 @@ set(EP_polarssl_GIT_REPOSITORY "git://git.linphone.org/polarssl.git" CACHE STRIN
set(EP_polarssl_GIT_TAG_LATEST "linphone-1.4" CACHE STRING "polarssl tag to use when compiling latest version")
set(EP_polarssl_GIT_TAG "3b7c2443e75e51b7af67a3e5dcb3771ae3120ff3" CACHE STRING "polarssl tag to use")
set(EP_polarssl_EXTERNAL_SOURCE_PATHS "polarssl" "externals/polarssl")
set(EP_polarssl_MAY_BE_FOUND_ON_SYSTEM TRUE)
set(EP_polarssl_LINKING_TYPE "-DUSE_SHARED_POLARSSL_LIBRARY=1")
if(MSVC)
......
......@@ -24,6 +24,7 @@ set(EP_speex_GIT_REPOSITORY "git://git.linphone.org/speex.git" CACHE STRING "spe
set(EP_speex_GIT_TAG_LATEST "linphone" CACHE STRING "speex tag to use when compiling latest version")
set(EP_speex_GIT_TAG "fc1dd43c3c9d244bca1c300e408ce0373dbd5ed8" CACHE STRING "speex tag to use")
set(EP_speex_EXTERNAL_SOURCE_PATHS "speex" "externals/speex")
set(EP_speex_MAY_BE_FOUND_ON_SYSTEM TRUE)
set(EP_speex_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
set(EP_speex_CMAKE_OPTIONS "-DENABLE_SPEEX_DSP=YES" "-DENABLE_SPEEX_CODEC=${ENABLE_SPEEX}")
......
......@@ -22,6 +22,7 @@
set(EP_sqlite3_URL "http://www.sqlite.org/2014/sqlite-amalgamation-3080702.zip")
set(EP_sqlite3_URL_HASH "MD5=10587262e4381358b707df75392c895f")
set(EP_sqlite3_MAY_BE_FOUND_ON_SYSTEM TRUE)
set(EP_sqlite3_PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/sqlite3/CMakeLists.txt" "<SOURCE_DIR>")
if(WIN32)
......
......@@ -24,6 +24,7 @@ set(EP_srtp_GIT_REPOSITORY "git://git.linphone.org/srtp.git" CACHE STRING "srtp
set(EP_srtp_GIT_TAG_LATEST "master" CACHE STRING "srtp tag to use when compiling latest version")
set(EP_srtp_GIT_TAG "befc23777e07efba36ffd7bda73f22c92d4e2475" CACHE STRING "srtp tag to use")
set(EP_srtp_EXTERNAL_SOURCE_PATHS "srtp" "externals/srtp")
set(EP_srtp_MAY_BE_FOUND_ON_SYSTEM TRUE)
set(EP_srtp_LINKING_TYPE ${DEFAULT_VALUE_CMAKE_LINKING_TYPE})
if(MSVC)
......
......@@ -22,6 +22,7 @@
set(EP_v4l_URL "http://linuxtv.org/downloads/v4l-utils/v4l-utils-1.0.0.tar.bz2")
set(EP_v4l_URL_HASH "MD5=2127f2d06be9162b0d346f7037a9e852")
set(EP_v4l_MAY_BE_FOUND_ON_SYSTEM TRUE)
set(EP_v4l_BUILD_METHOD "autotools")
set(EP_v4l_CROSS_COMPILATION_OPTIONS
......
......@@ -39,6 +39,7 @@ else()
set(EP_vpx_URL "http://storage.googleapis.com/downloads.webmproject.org/releases/webm/libvpx-1.5.0.tar.bz2")
set(EP_vpx_URL_HASH "MD5=49e59dd184caa255886683facea56fca")
set(EP_vpx_EXTERNAL_SOURCE_PATHS "externals/libvpx")
set(EP_vpx_MAY_BE_FOUND_ON_SYSTEM TRUE)
set(EP_vpx_BUILD_METHOD "autotools")
set(EP_vpx_DO_NOT_USE_CMAKE_FLAGS TRUE)
set(EP_vpx_CONFIG_H_FILE vpx_config.h)
......
......@@ -36,6 +36,7 @@ else()
set(EP_xml2_GIT_REPOSITORY "git://git.linphone.org/libxml2" CACHE STRING "xml2 repository URL")
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_MAY_BE_FOUND_ON_SYSTEM TRUE)
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>")
......
......@@ -24,6 +24,7 @@ set(EP_zlib_GIT_REPOSITORY "git://git.linphone.org/zlib.git" CACHE STRING "zlib
set(EP_zlib_GIT_TAG_LATEST "master" CACHE STRING "zlib tag to use when compiling latest version")
set(EP_zlib_GIT_TAG "91eb77a7c5bfe7b4cc6b722aa96548d7143a9936" CACHE STRING "zlib tag to use")
set(EP_zlib_EXTERNAL_SOURCE_PATHS "zlib")
set(EP_zlib_MAY_BE_FOUND_ON_SYSTEM TRUE)
if(MSVC)
set(EP_zlib_EXTRA_LDFLAGS "/SAFESEH:NO")
......
......@@ -51,6 +51,7 @@ set(LINPHONE_BUILDER_EP_VARS)
set(LINPHONE_BUILDER_INCLUDED_BUILDERS)
set(LINPHONE_BUILDER_INCLUDED_BUILDERS_TO_EXCLUDE)
set(LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH_BUILDERS)
set(LINPHONE_BUILDER_SYSTEM_DEPENDENCIES_BUILDERS)
macro(linphone_builder_expand_external_project_vars)
set(LINPHONE_BUILDER_EP_ARGS "")
......@@ -219,7 +220,14 @@ endmacro()
macro(linphone_builder_add_builder_to_target TARGETNAME BUILDER)
linphone_builder_include_builder(${BUILDER})
if(LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH AND (LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS OR LINPHONE_BUILDER_BUILD_ONLY_EXTERNAL_SOURCE_PATH))
if(LINPHONE_BUILDER_USE_SYSTEM_DEPENDENCIES AND EP_${BUILDER}_MAY_BE_FOUND_ON_SYSTEM)
list(FIND LINPHONE_BUILDER_SYSTEM_DEPENDENCIES_BUILDERS ${BUILDER} _already_included)
if(_already_included EQUAL -1)
message(" Using ${BUILDER} from the system")
list(APPEND LINPHONE_BUILDER_INCLUDED_BUILDERS_TO_EXCLUDE ${BUILDER})
list(APPEND LINPHONE_BUILDER_SYSTEM_DEPENDENCIES_BUILDERS ${BUILDER})
endif()
elseif(LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH AND LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
foreach(SUBDIR ${EP_${BUILDER}_EXTERNAL_SOURCE_PATHS})
if(SUBDIR STREQUAL "<LINPHONE_BUILDER_TOP_DIR>")
set(_source_dir "${LINPHONE_BUILDER_TOP_DIR}")
......@@ -240,8 +248,6 @@ macro(linphone_builder_add_builder_to_target TARGETNAME BUILDER)
list(APPEND LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH_BUILDERS ${BUILDER})
endif()
unset(_already_included)
elseif(LINPHONE_BUILDER_BUILD_ONLY_EXTERNAL_SOURCE_PATH)
list(APPEND LINPHONE_BUILDER_INCLUDED_BUILDERS_TO_EXCLUDE ${BUILDER})
else()
#message(" ${TARGETNAME} depends on external project EP_${BUILDER}")
add_dependencies(${TARGETNAME} EP_${BUILDER})
......
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