Commit 505f536c authored by Ghislain MARY's avatar Ghislain MARY

Set SDK version to 4.1.

parent 93dbe2f0
......@@ -23,7 +23,7 @@
cmake_minimum_required(VERSION 3.2)
project(linphone-sdk VERSION 0.0.1 LANGUAGES NONE)
project(linphone-sdk VERSION 4.1 LANGUAGES NONE)
set(LINPHONESDK_DIR "${CMAKE_CURRENT_LIST_DIR}")
......@@ -32,6 +32,7 @@ include(LinphoneSdkUtils)
linphone_sdk_git_submodule_update()
linphone_sdk_compute_full_version(LINPHONESDK_VERSION)
set(LINPHONESDK_PREBUILD_DEPENDENCIES)
......
......@@ -25,7 +25,7 @@ if(NOT PYTHONINTERP_FOUND)
message(FATAL_ERROR "Could not find python!")
endif()
linphone_sdk_check_is_installed(git)
linphone_sdk_check_git()
if(ENABLE_CSHARP_WRAPPER OR ENABLE_CXX_WRAPPER OR ENABLE_DOC OR ENABLE_JAVA_WRAPPER)
linphone_sdk_check_is_installed(doxygen)
......
......@@ -32,7 +32,7 @@ list(GET _archs 0 _first_arch)
add_custom_target(gradle-clean ALL
"${CMAKE_COMMAND}" "-DLINPHONESDK_DIR=${LINPHONESDK_DIR}" "-DLINPHONESDK_BUILD_DIR=${CMAKE_BINARY_DIR}" "-DLINPHONESDK_VERSION=${linphone-sdk_VERSION}" "-DLINPHONESDK_FIRST_ARCH=${_first_arch}" "-P" "${LINPHONESDK_DIR}/cmake/Android/GradleClean.cmake"
"${CMAKE_COMMAND}" "-DLINPHONESDK_DIR=${LINPHONESDK_DIR}" "-DLINPHONESDK_BUILD_DIR=${CMAKE_BINARY_DIR}" "-DLINPHONESDK_VERSION=${LINPHONESDK_VERSION}" "-DLINPHONESDK_FIRST_ARCH=${_first_arch}" "-P" "${LINPHONESDK_DIR}/cmake/Android/GradleClean.cmake"
)
list(APPEND LINPHONESDK_PREBUILD_DEPENDENCIES gradle-clean)
......
......@@ -103,7 +103,7 @@ add_custom_target(lipo ALL
)
add_custom_target(sdk
"${CMAKE_COMMAND}" "-DLINPHONESDK_DIR=${LINPHONESDK_DIR}" "-DLINPHONESDK_BUILD_DIR=${CMAKE_BINARY_DIR}" "-DLINPHONESDK_VERSION=${linphone-sdk_VERSION}" "-DLINPHONESDK_IOS_BASE_URL=${LINPHONESDK_IOS_BASE_URL}" "-P" "${LINPHONESDK_DIR}/cmake/IOS/GenerateSDK.cmake"
"${CMAKE_COMMAND}" "-DLINPHONESDK_DIR=${LINPHONESDK_DIR}" "-DLINPHONESDK_BUILD_DIR=${CMAKE_BINARY_DIR}" "-DLINPHONESDK_VERSION=${LINPHONESDK_VERSION}" "-DLINPHONESDK_IOS_BASE_URL=${LINPHONESDK_IOS_BASE_URL}" "-P" "${LINPHONESDK_DIR}/cmake/IOS/GenerateSDK.cmake"
COMMENT "Generating the SDK (zip file and podspec)"
DEPENDS lipo
)
......@@ -24,17 +24,17 @@ list(APPEND CMAKE_MODULE_PATH "${LINPHONESDK_DIR}/cmake")
include(LinphoneSdkUtils)
linphone_sdk_check_is_installed(git)
linphone_sdk_check_git()
if(IS_DIRECTORY "${LINPHONESDK_DIR}/tunnel")
execute_process(
COMMAND "${LINPHONESDK_GIT_PROGRAM}" "pull"
COMMAND "${GIT_EXECUTABLE}" "pull"
WORKING_DIRECTORY "${LINPHONESDK_DIR}/tunnel"
)
else()
execute_process(
COMMAND "${LINPHONESDK_GIT_PROGRAM}" "clone" "git@gitlab.linphone.org:BC/private/tunnel.git" "tunnel"
COMMAND "${GIT_EXECUTABLE}" "clone" "git@gitlab.linphone.org:BC/private/tunnel.git" "tunnel"
WORKING_DIRECTORY "${LINPHONESDK_DIR}"
)
endif()
......@@ -60,16 +60,56 @@ macro(linphone_sdk_convert_comma_separated_list_to_cmake_list INPUT OUTPUT)
string(REPLACE "," ";" ${OUTPUT} "${${OUTPUT}}")
endmacro()
macro(linphone_sdk_check_git)
find_package(Git 1.7.10)
endmacro()
function(linphone_sdk_git_submodule_update)
if(NOT EXISTS "${LINPHONESDK_DIR}/linphone/CMakeLists.txt")
linphone_sdk_check_is_installed(git)
linphone_sdk_check_git()
execute_process(
COMMAND "${LINPHONESDK_GIT_PROGRAM}" "submodule" "update" "--recursive" "--init"
COMMAND "${GIT_EXECUTABLE}" "submodule" "update" "--recursive" "--init"
WORKING_DIRECTORY "${LINPHONESDK_DIR}"
)
endif()
endfunction()
macro(linphone_sdk_compute_full_version OUTPUT_VERSION)
linphone_sdk_check_git()
if(GIT_EXECUTABLE)
execute_process(
COMMAND "${GIT_EXECUTABLE}" "describe"
OUTPUT_VARIABLE ${OUTPUT_VERSION}
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
)
message("${OUTPUT_VERSION}: ${${OUTPUT_VERSION}}")
if(${OUTPUT_VERSION})
execute_process(
COMMAND "${GIT_EXECUTABLE}" "describe" "--abbrev=0"
OUTPUT_VARIABLE PROJECT_GIT_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
)
if(NOT PROJECT_GIT_TAG VERSION_EQUAL PROJECT_VERSION)
message(FATAL_ERROR "Project version (${PROJECT_VERSION}) and git tag (${PROJECT_GIT_TAG}) differ! Please synchronize them.")
endif()
unset(PROJECT_GIT_TAG)
else()
execute_process(
COMMAND "${GIT_EXECUTABLE}" "rev-parse" "HEAD"
OUTPUT_VARIABLE PROJECT_GIT_REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
)
set(${OUTPUT_VERSION} "${PROJECT_VERSION}-g${PROJECT_GIT_REVISION}")
endif()
endif()
endmacro()
macro(linphone_sdk_check_is_installed EXECUTABLE_NAME)
string(TOUPPER "${EXECUTABLE_NAME}" _upper_executable_name)
find_program(LINPHONESDK_${_upper_executable_name}_PROGRAM ${EXECUTABLE_NAME})
......
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