Commit 15762b94 authored by Ghislain MARY's avatar Ghislain MARY

Allow CMake build without building the dependencies but using the ones on the system.

parent ab9ba5de
......@@ -32,6 +32,7 @@ set_property(CACHE LINPHONE_BUILDER_TARGET PROPERTY STRINGS "belle-sip" "ortp" "
set(LINPHONE_BUILDER_PREBUILT_URL "" CACHE STRING "URL to download some prebuilt dependencies.")
option(LINPHONE_BUILDER_LATEST "Build latest versions (from git)." NO)
option(LINPHONE_BUILDER_CHECK_LASTEST "Check that the git revisions are the latest ones." NO)
option(LINPHONE_BUILDER_BUILD_DEPENDENCIES "Build the dependencies instead of using the system libraries." YES)
# Include macros definition to be used by builders
......
......@@ -58,10 +58,12 @@ else()
if(_target_found GREATER -1)
add_custom_target(TARGET_bellesip ALL)
add_dependencies(TARGET_linphone_builder TARGET_bellesip)
linphone_builder_add_builder_to_target(TARGET_bellesip antlr3c)
linphone_builder_add_builder_to_target(TARGET_bellesip polarssl)
if(ENABLE_UNIT_TESTS)
linphone_builder_add_builder_to_target(TARGET_bellesip cunit)
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES)
linphone_builder_add_builder_to_target(TARGET_bellesip antlr3c)
linphone_builder_add_builder_to_target(TARGET_bellesip polarssl)
if(ENABLE_UNIT_TESTS)
linphone_builder_add_builder_to_target(TARGET_bellesip cunit)
endif()
endif()
if(ENABLE_TUNNEL)
linphone_builder_add_builder_to_target(TARGET_bellesip tunnel)
......@@ -75,9 +77,6 @@ else()
if(_target_found GREATER -1)
add_custom_target(TARGET_ortp ALL)
add_dependencies(TARGET_linphone_builder TARGET_ortp)
if(ENABLE_UNIT_TESTS)
linphone_builder_add_builder_to_target(TARGET_ortp cunit)
endif()
linphone_builder_add_builder_to_target(TARGET_ortp ortp)
endif()
......@@ -88,33 +87,37 @@ else()
add_custom_target(TARGET_ms2 ALL)
add_dependencies(TARGET_linphone_builder TARGET_ms2)
add_dependencies(TARGET_ms2 TARGET_ortp)
if(ENABLE_UNIT_TESTS)
linphone_builder_add_builder_to_target(TARGET_ms2 cunit)
endif()
if(ENABLE_GSM)
linphone_builder_add_builder_to_target(TARGET_ms2 gsm)
endif()
if(ENABLE_OPUS)
linphone_builder_add_builder_to_target(TARGET_ms2 opus)
endif()
if(ENABLE_SPEEX)
linphone_builder_add_builder_to_target(TARGET_ms2 speex)
endif()
if(ENABLE_FFMPEG)
linphone_builder_add_builder_to_target(TARGET_ms2 ffmpeg)
endif()
if(ENABLE_VPX)
linphone_builder_add_builder_to_target(TARGET_ms2 vpx)
endif()
if(ENABLE_V4L)
linphone_builder_add_builder_to_target(TARGET_ms2 v4l)
endif()
if(ENABLE_SRTP)
linphone_builder_add_builder_to_target(TARGET_ms2 srtp)
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES)
if(ENABLE_UNIT_TESTS)
linphone_builder_add_builder_to_target(TARGET_ms2 cunit)
endif()
if(ENABLE_GSM)
linphone_builder_add_builder_to_target(TARGET_ms2 gsm)
endif()
if(ENABLE_OPUS)
linphone_builder_add_builder_to_target(TARGET_ms2 opus)
endif()
if(ENABLE_SPEEX)
linphone_builder_add_builder_to_target(TARGET_ms2 speex)
endif()
if(ENABLE_FFMPEG)
linphone_builder_add_builder_to_target(TARGET_ms2 ffmpeg)
endif()
if(ENABLE_VPX)
linphone_builder_add_builder_to_target(TARGET_ms2 vpx)
endif()
if(ENABLE_V4L)
linphone_builder_add_builder_to_target(TARGET_ms2 v4l)
endif()
if(ENABLE_SRTP)
linphone_builder_add_builder_to_target(TARGET_ms2 srtp)
endif()
if(ENABLE_ZRTP)
linphone_builder_add_builder_to_target(TARGET_ms2 polarssl)
linphone_builder_add_builder_to_target(TARGET_ms2 xml2)
endif()
endif()
if(ENABLE_ZRTP)
linphone_builder_add_builder_to_target(TARGET_ms2 polarssl)
linphone_builder_add_builder_to_target(TARGET_ms2 xml2)
linphone_builder_add_builder_to_target(TARGET_ms2 bzrtp)
endif()
linphone_builder_add_builder_to_target(TARGET_ms2 ms2)
......@@ -166,10 +169,12 @@ else()
add_custom_target(TARGET_linphone ALL)
add_dependencies(TARGET_linphone_builder TARGET_linphone)
add_dependencies(TARGET_linphone TARGET_bellesip TARGET_ortp TARGET_ms2)
linphone_builder_add_builder_to_target(TARGET_linphone sqlite3)
linphone_builder_add_builder_to_target(TARGET_linphone xml2)
if(ENABLE_UNIT_TESTS)
linphone_builder_add_builder_to_target(TARGET_linphone cunit)
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES)
linphone_builder_add_builder_to_target(TARGET_linphone sqlite3)
linphone_builder_add_builder_to_target(TARGET_linphone xml2)
if(ENABLE_UNIT_TESTS)
linphone_builder_add_builder_to_target(TARGET_linphone cunit)
endif()
endif()
if(ENABLE_TUNNEL)
linphone_builder_add_builder_to_target(TARGET_linphone tunnel)
......
......@@ -26,7 +26,10 @@ set(EP_bellesip_GIT_TAG "6c715fb57234f26a54c0f0576ee86e2763c01601")
set(EP_bellesip_CMAKE_OPTIONS )
set(EP_bellesip_LINKING_TYPE "-DENABLE_STATIC=0")
set(EP_bellesip_DEPENDENCIES EP_antlr3c EP_polarssl)
set(EP_bellesip_DEPENDENCIES )
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES)
list(APPEND EP_bellesip_DEPENDENCIES EP_antlr3c EP_polarssl)
endif()
if(MSVC)
set(EP_bellesip_EXTRA_LDFLAGS "/SAFESEH:NO")
endif()
......@@ -38,7 +41,10 @@ else()
list(APPEND EP_bellesip_CMAKE_OPTIONS "-DENABLE_TUNNEL=0")
endif()
if(ENABLE_UNIT_TESTS)
list(APPEND EP_bellesip_DEPENDENCIES EP_cunit)
list(APPEND EP_bellesip_CMAKE_OPTIONS "-DENABLE_TESTS=1")
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES)
list(APPEND EP_bellesip_DEPENDENCIES EP_cunit)
endif()
else()
list(APPEND EP_bellesip_CMAKE_OPTIONS "-DENABLE_TESTS=0")
endif()
......@@ -26,7 +26,10 @@ set(EP_bzrtp_GIT_TAG "afc9b57689e2462b63de358ba083c64265e4ac8f")
set(EP_bzrtp_CMAKE_OPTIONS )
set(EP_bzrtp_LINKING_TYPE "-DENABLE_STATIC=0")
set(EP_bzrtp_DEPENDENCIES EP_polarssl EP_xml2)
set(EP_bzrtp_DEPENDENCIES )
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES)
list(APPEND EP_bzrtp_DEPENDENCIES EP_polarssl EP_xml2)
endif()
if(MSVC)
set(EP_bzrtp_EXTRA_LDFLAGS "/SAFESEH:NO")
endif()
......@@ -36,7 +39,9 @@ endif()
if(ENABLE_UNIT_TESTS)
list(APPEND EP_bzrtp_CMAKE_OPTIONS "-DENABLE_TESTS=1")
list(APPEND EP_bzrtp_DEPENDENCIES EP_cunit)
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES)
list(APPEND EP_bzrtp_DEPENDENCIES EP_cunit)
endif()
else()
list(APPEND EP_bzrtp_CMAKE_OPTIONS "-DENABLE_TESTS=0")
endif()
......@@ -26,7 +26,10 @@ set(EP_linphone_GIT_TAG "052206a321875330ac643b3719b7a03fd6501be6")
set(EP_linphone_CMAKE_OPTIONS )
set(EP_linphone_LINKING_TYPE "-DENABLE_STATIC=NO")
set(EP_linphone_DEPENDENCIES EP_bellesip EP_ortp EP_ms2 EP_sqlite3 EP_xml2)
set(EP_linphone_DEPENDENCIES EP_bellesip EP_ortp EP_ms2)
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES)
list(APPEND EP_linphone_DEPENDENCIES EP_sqlite3 EP_xml2)
endif()
if(ENABLE_VIDEO)
list(APPEND EP_linphone_CMAKE_OPTIONS "-DENABLE_VIDEO=YES")
else()
......@@ -34,11 +37,15 @@ else()
endif()
if(ENABLE_TUNNEL)
list(APPEND EP_linphone_CMAKE_OPTIONS "-DENABLE_TUNNEL=YES")
list(APPEND EP_linphone_DEPENDENCIES EP_tunnel)
else()
list(APPEND EP_linphone_CMAKE_OPTIONS "-DENABLE_TUNNEL=NO")
endif()
if(ENABLE_UNIT_TESTS)
list(APPEND EP_linphone_CMAKE_OPTIONS "-DENABLE_UNIT_TESTS=YES")
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES)
list(APPEND EP_linphone_DEPENDENCIES EP_cunit)
endif()
else()
list(APPEND EP_linphone_CMAKE_OPTIONS "-DENABLE_UNIT_TESTS=NO")
endif()
......
......@@ -29,19 +29,25 @@ set(EP_ms2_LINKING_TYPE "-DENABLE_STATIC=NO")
set(EP_ms2_DEPENDENCIES EP_ortp)
if(ENABLE_GSM)
list(APPEND EP_ms2_CMAKE_OPTIONS "-DENABLE_GSM=YES")
list(APPEND EP_ms2_DEPENDENCIES EP_gsm)
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES)
list(APPEND EP_ms2_DEPENDENCIES EP_gsm)
endif()
else()
list(APPEND EP_ms2_CMAKE_OPTIONS "-DENABLE_GSM=NO")
endif()
if(ENABLE_OPUS)
list(APPEND EP_ms2_CMAKE_OPTIONS "-DENABLE_OPUS=YES")
list(APPEND EP_ms2_DEPENDENCIES EP_opus)
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES)
list(APPEND EP_ms2_DEPENDENCIES EP_opus)
endif()
else()
list(APPEND EP_ms2_CMAKE_OPTIONS "-DENABLE_OPUS=NO")
endif()
if(ENABLE_SPEEX)
list(APPEND EP_ms2_CMAKE_OPTIONS "-DENABLE_SPEEX=YES")
list(APPEND EP_ms2_DEPENDENCIES EP_speex)
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES)
list(APPEND EP_ms2_DEPENDENCIES EP_speex)
endif()
else()
list(APPEND EP_ms2_CMAKE_OPTIONS "-DENABLE_SPEEX=NO")
endif()
......@@ -49,13 +55,17 @@ if(ENABLE_VIDEO)
list(APPEND EP_ms2_CMAKE_OPTIONS "-DENABLE_VIDEO=YES")
if(ENABLE_FFMPEG)
list(APPEND EP_ms2_CMAKE_OPTIONS "-DENABLE_FFMPEG=YES")
list(APPEND EP_ms2_DEPENDENCIES EP_ffmpeg)
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES)
list(APPEND EP_ms2_DEPENDENCIES EP_ffmpeg)
endif()
else()
list(APPEND EP_ms2_CMAKE_OPTIONS "-DENABLE_FFMPEG=NO")
endif()
if(ENABLE_VPX)
list(APPEND EP_ms2_CMAKE_OPTIONS "-DENABLE_VPX=YES")
list(APPEND EP_ms2_DEPENDENCIES EP_vpx)
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES)
list(APPEND EP_ms2_DEPENDENCIES EP_vpx)
endif()
else()
list(APPEND EP_ms2_CMAKE_OPTIONS "-DENABLE_VPX=NO")
endif()
......@@ -64,7 +74,9 @@ else()
endif()
if(ENABLE_SRTP)
list(APPEND EP_ms2_CMAKE_OPTIONS "-DENABLE_SRTP=1")
list(APPEND EP_ms2_DEPENDENCIES EP_srtp)
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES)
list(APPEND EP_ms2_DEPENDENCIES EP_srtp)
endif()
else()
list(APPEND EP_ms2_CMAKE_OPTIONS "-DENABLE_SRTP=0")
endif()
......@@ -79,7 +91,7 @@ if(ENABLE_UNIT_TESTS)
else()
list(APPEND EP_ms2_CMAKE_OPTIONS "-DENABLE_UNIT_TESTS=NO")
endif()
if(ENABLE_V4L)
if(ENABLE_V4L AND LINPHONE_BUILDER_BUILD_DEPENDENCIES)
list(APPEND EP_ms2_DEPENDENCIES EP_v4l)
endif()
if(MSVC)
......
......@@ -26,4 +26,7 @@ set(EP_tunnel_GIT_TAG "1182be7fdefcf9717451fc2a8f67f645c5e4d2c9")
set(EP_tunnel_LINKING_TYPE "-DENABLE_STATIC=0")
set(EP_tunnel_CMAKE_OPTIONS "-DENABLE_SERVERS=0")
set(EP_tunnel_DEPENDENCIES EP_polarssl)
set(EP_tunnel_DEPENDENCIES )
if(LINPHONE_BUILDER_BUILD_DEPENDENCIES)
list(APPEND EP_tunnel_DEPENDENCIES EP_polarssl)
endif()
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