Commit c7fa6a0a authored by Ghislain MARY's avatar Ghislain MARY

Add option to set an external source path.

The idea is to be able to build sources from already cloned git submodules
instead of getting the sources via the ExternalProjects.
parent 252b73bf
......@@ -33,6 +33,7 @@ set(LINPHONE_BUILDER_PREBUILT_URL "" CACHE STRING "URL to download some prebuilt
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)
set(LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH "" CACHE STRING "External path to source code that is available.")
# Include macros definition to be used by builders
......
......@@ -23,6 +23,7 @@
set(EP_ortp_GIT_REPOSITORY "git://git.linphone.org/ortp.git")
set(EP_ortp_GIT_TAG_LATEST "master")
set(EP_ortp_GIT_TAG "19ed314d52d4061a21daa4805aef9459ad31640c")
set(EP_ortp_EXTERNAL_SOURCE_PATHS "oRTP" "ortp" "linphone/oRTP")
if("${EP_ortp_FORCE_AUTOTOOLS}" STREQUAL "yes")
set(EP_ortp_LINKING_TYPE "--enable-static")
......
......@@ -631,34 +631,31 @@ function(linphone_builder_add_project PROJNAME)
)
else()
# Use CMake build method
if("${CMAKE_VERSION}" VERSION_GREATER "2.8.3")
set(BUILD_COMMANDS
CMAKE_ARGS ${EP_${PROJNAME}_CMAKE_OPTIONS} ${EP_${PROJNAME}_LINKING_TYPE}
CMAKE_CACHE_ARGS ${LINPHONE_BUILDER_EP_ARGS}
)
else("${CMAKE_VERSION}" VERSION_GREATER "2.8.3")
set(BUILD_COMMANDS
CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} ${EP_${PROJNAME}_CMAKE_OPTIONS} ${EP_${PROJNAME}_LINKING_TYPE}
)
endif("${CMAKE_VERSION}" VERSION_GREATER "2.8.3")
set(BUILD_COMMANDS
CMAKE_ARGS ${EP_${PROJNAME}_CMAKE_OPTIONS} ${EP_${PROJNAME}_LINKING_TYPE}
CMAKE_CACHE_ARGS ${LINPHONE_BUILDER_EP_ARGS}
)
endif()
if(NOT "${EP_${PROJNAME}_URL}" STREQUAL "")
set(DOWNLOAD_SOURCE URL ${EP_${PROJNAME}_URL})
if(NOT "${EP_${PROJNAME}_URL_HASH}" STREQUAL "")
if("${CMAKE_VERSION}" VERSION_GREATER "2.8.9")
list(APPEND DOWNLOAD_SOURCE URL_HASH ${EP_${PROJNAME}_URL_HASH})
else()
string(REGEX MATCH "^MD5=([A-Fa-f0-9]+)$" _match ${EP_${PROJNAME}_URL_HASH})
if(NOT "${_match}" STREQUAL "")
string(REGEX REPLACE "MD5=" "" _match ${_match})
list(APPEND DOWNLOAD_SOURCE URL_MD5 ${_match})
if(LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH)
foreach(SUBDIR ${EP_${PROJNAME}_EXTERNAL_SOURCE_PATHS})
if(NOT EP_${PROJNAME}_SOURCE_DIR)
if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH}/${SUBDIR}")
set(EP_${PROJNAME}_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${LINPHONE_BUILDER_EXTERNAL_SOURCE_PATH}/${SUBDIR}")
endif()
unset(_match)
endif()
endif()
elseif(LINPHONE_BUILDER_LATEST AND EP_${PROJNAME}_GIT_TAG_LATEST)
endforeach()
endif()
if(LINPHONE_BUILDER_LATEST AND EP_${PROJNAME}_GIT_TAG_LATEST)
set(DOWNLOAD_SOURCE GIT_REPOSITORY ${EP_${PROJNAME}_GIT_REPOSITORY} GIT_TAG ${EP_${PROJNAME}_GIT_TAG_LATEST})
elseif(EP_${PROJNAME}_SOURCE_DIR)
set(DOWNLOAD_SOURCE SOURCE_DIR ${EP_${PROJNAME}_SOURCE_DIR})
elseif(EP_${PROJNAME}_URL)
set(DOWNLOAD_SOURCE URL ${EP_${PROJNAME}_URL})
if(EP_${PROJNAME}_URL_HASH)
list(APPEND DOWNLOAD_SOURCE URL_HASH ${EP_${PROJNAME}_URL_HASH})
endif()
else()
set(DOWNLOAD_SOURCE GIT_REPOSITORY ${EP_${PROJNAME}_GIT_REPOSITORY} GIT_TAG ${EP_${PROJNAME}_GIT_TAG})
endif()
......
......@@ -170,7 +170,7 @@ class WindowsPhoneTarget(Target):
self.generator = 'Visual Studio 12 2013'
self.platform_name = platform
self.output = 'OUTPUT/liblinphone-windowsphone-sdk/' + arch
self.additional_args = ['-DCMAKE_SYSTEM_NAME=WindowsPhone', '-DCMAKE_SYSTEM_VERSION=8.0']
self.additional_args = ['-DCMAKE_SYSTEM_NAME=WindowsPhone', '-DCMAKE_SYSTEM_VERSION=8.0', '-DLINPHONE_BUILDER_EXTERNAL_SOURCE_PATH=../submodules']
class WindowsPhoneARMTarget(WindowsPhoneTarget):
def __init__(self):
......
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