Commit 21f782ca authored by Ghislain MARY's avatar Ghislain MARY

Allow downloading source code from an URL.

parent db8668e0
...@@ -164,12 +164,17 @@ macro(linphone_builder_add_cmake_project PROJNAME) ...@@ -164,12 +164,17 @@ macro(linphone_builder_add_cmake_project PROJNAME)
linphone_builder_apply_extra_flags("${EP_${PROJNAME}_EXTRA_CFLAGS}" "${EP_${PROJNAME}_EXTRA_CXXFLAGS}" "${EP_${PROJNAME}_EXTRA_LDFLAGS}") linphone_builder_apply_extra_flags("${EP_${PROJNAME}_EXTRA_CFLAGS}" "${EP_${PROJNAME}_EXTRA_CXXFLAGS}" "${EP_${PROJNAME}_EXTRA_LDFLAGS}")
linphone_builder_expand_external_project_vars() linphone_builder_expand_external_project_vars()
if(NOT "${EP_${PROJNAME}_URL}" STREQUAL "")
set(DOWNLOAD_SOURCE URL ${EP_${PROJNAME}_URL})
else(NOT "${EP_${PROJNAME}_URL}" STREQUAL "")
set(DOWNLOAD_SOURCE GIT_REPOSITORY ${EP_${PROJNAME}_GIT_REPOSITORY} GIT_TAG ${EP_${PROJNAME}_GIT_TAG})
endif(NOT "${EP_${PROJNAME}_URL}" STREQUAL "")
ExternalProject_Add(EP_${PROJNAME} ExternalProject_Add(EP_${PROJNAME}
DEPENDS ${EP_${PROJNAME}_DEPENDENCIES} DEPENDS ${EP_${PROJNAME}_DEPENDENCIES}
TMP_DIR ${ep_tmp} TMP_DIR ${ep_tmp}
BINARY_DIR ${ep_build} BINARY_DIR ${ep_build}
GIT_REPOSITORY ${EP_${PROJNAME}_GIT_REPOSITORY} ${DOWNLOAD_SOURCE}
GIT_TAG ${EP_${PROJNAME}_GIT_TAG}
PATCH_COMMAND ${EP_${PROJNAME}_PATCH_COMMAND} PATCH_COMMAND ${EP_${PROJNAME}_PATCH_COMMAND}
CMAKE_GENERATOR ${CMAKE_GENERATOR} CMAKE_GENERATOR ${CMAKE_GENERATOR}
CMAKE_ARGS ${EP_${PROJNAME}_CMAKE_OPTIONS} CMAKE_ARGS ${EP_${PROJNAME}_CMAKE_OPTIONS}
...@@ -186,12 +191,17 @@ macro(linphone_builder_add_autotools_project PROJNAME) ...@@ -186,12 +191,17 @@ macro(linphone_builder_add_autotools_project PROJNAME)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/builders/${PROJNAME}/build.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_build.sh) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/builders/${PROJNAME}/build.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_build.sh)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/builders/${PROJNAME}/install.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_install.sh) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/builders/${PROJNAME}/install.sh.cmake ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_install.sh)
if(NOT "${EP_${PROJNAME}_URL}" STREQUAL "")
set(DOWNLOAD_SOURCE URL ${EP_${PROJNAME}_URL})
else(NOT "${EP_${PROJNAME}_URL}" STREQUAL "")
set(DOWNLOAD_SOURCE GIT_REPOSITORY ${EP_${PROJNAME}_GIT_REPOSITORY} GIT_TAG ${EP_${PROJNAME}_GIT_TAG})
endif(NOT "${EP_${PROJNAME}_URL}" STREQUAL "")
ExternalProject_Add(EP_${PROJNAME} ExternalProject_Add(EP_${PROJNAME}
DEPENDS ${EP_${PROJNAME}_DEPENDENCIES} DEPENDS ${EP_${PROJNAME}_DEPENDENCIES}
TMP_DIR ${ep_tmp} TMP_DIR ${ep_tmp}
BINARY_DIR ${ep_build} BINARY_DIR ${ep_build}
GIT_REPOSITORY ${EP_${PROJNAME}_GIT_REPOSITORY} ${DOWNLOAD_SOURCE}
GIT_TAG ${EP_${PROJNAME}_GIT_TAG}
PATCH_COMMAND ${EP_${PROJNAME}_PATCH_COMMAND} PATCH_COMMAND ${EP_${PROJNAME}_PATCH_COMMAND}
CMAKE_GENERATOR ${CMAKE_GENERATOR} CMAKE_GENERATOR ${CMAKE_GENERATOR}
CONFIGURE_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_configure.sh CONFIGURE_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_configure.sh
......
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