Commit d22e78e5 authored by Ghislain MARY's avatar Ghislain MARY

Add possibility to have builders with custom configure, build and install commands.

parent 337bf495
......@@ -22,7 +22,7 @@
set(EP_bcg729_GIT_REPOSITORY "git://git.linphone.org/bcg729.git")
set(EP_bcg729_GIT_TAG "2634faf85a13f79fece045e37515ddd1ea48dc25") # Branch 'master'
set(EP_bcg729_USE_AUTOTOOLS "yes")
set(EP_bcg729_BUILD_METHOD "autotools")
set(EP_bcg729_USE_AUTOGEN "yes")
set(EP_bcg729_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
......
......@@ -21,7 +21,7 @@
############################################################################
set(EP_ffmpeg_URL "http://ffmpeg.org/releases/ffmpeg-0.10.2.tar.gz")
set(EP_ffmpeg_USE_AUTOTOOLS "yes")
set(EP_ffmpeg_BUILD_METHOD "autotools")
set(EP_ffmpeg_CONFIGURE_OPTIONS
"--disable-zlib"
"--disable-bzlib"
......
......@@ -22,7 +22,7 @@
set(EP_libilbcrfc3951_GIT_REPOSITORY "git://git.linphone.org/libilbc-rfc3951.git")
set(EP_libilbcrfc3951_GIT_TAG "e8084bdc3b182a3dcf57ae97ea72bbef26d423db")
set(EP_libilbcrfc3951_USE_AUTOTOOLS "yes")
set(EP_libilbcrfc3951_BUILD_METHOD "autotools")
set(EP_libilbcrfc3951_USE_AUTOGEN "yes")
set(EP_libilbcrfc3951_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
......
......@@ -28,7 +28,7 @@ if(WIN32)
set(EP_linphone_DEPENDENCIES EP_bellesip EP_ortp EP_ms2 EP_xml2)
set(EP_linphone_EXTRA_LDFLAGS "/SAFESEH:NO")
else(WIN32)
set(EP_linphone_USE_AUTOTOOLS "yes")
set(EP_linphone_BUILD_METHOD "autotools")
set(EP_linphone_USE_AUTOGEN "yes")
set(EP_linphone_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
......
......@@ -28,7 +28,7 @@ if(WIN32)
set(EP_ms2_DEPENDENCIES EP_ortp EP_opus EP_speex EP_ffmpeg EP_vpx)
set(EP_ms2_EXTRA_LDFLAGS "/SAFESEH:NO")
else(WIN32)
set(EP_ms2_USE_AUTOTOOLS "yes")
set(EP_ms2_BUILD_METHOD "autotools")
set(EP_ms2_USE_AUTOGEN "yes")
set(EP_ms2_CONFIG_H_FILE mediastreamer-config.h)
set(EP_ms2_CROSS_COMPILATION_OPTIONS
......
......@@ -22,7 +22,7 @@
set(EP_msamr_GIT_REPOSITORY "git://git.linphone.org/msamr.git")
set(EP_msamr_GIT_TAG "d09a19cb27076c45f093e8abc9a00d07258779e9") # Branch 'master'
set(EP_msamr_USE_AUTOTOOLS "yes")
set(EP_msamr_BUILD_METHOD "autotools")
set(EP_msamr_USE_AUTOGEN "yes")
set(EP_msamr_CONFIGURE_OPTIONS )
set(EP_msamr_CROSS_COMPILATION_OPTIONS
......
......@@ -22,7 +22,7 @@
set(EP_msilbc_GIT_REPOSITORY "git://git.linphone.org/msilbc.git")
set(EP_msilbc_GIT_TAG "3185bbbbda97c2b93cd4f720809b96d79d810bd9") # Branch 'master'
set(EP_msilbc_USE_AUTOTOOLS "yes")
set(EP_msilbc_BUILD_METHOD "autotools")
set(EP_msilbc_USE_AUTOGEN "yes")
set(EP_msilbc_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
......
......@@ -22,7 +22,7 @@
set(EP_msisac_GIT_REPOSITORY "git://git.linphone.org/msisac.git")
set(EP_msisac_GIT_TAG "fafe68323df68b5f4e18b15b350134a54888f2b4") # Branch 'master'
set(EP_msisac_USE_AUTOTOOLS "yes")
set(EP_msisac_BUILD_METHOD "autotools")
set(EP_msisac_USE_AUTOGEN "yes")
set(EP_msisac_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
......
......@@ -22,7 +22,7 @@
set(EP_mssilk_GIT_REPOSITORY "git://git.linphone.org/mssilk.git")
set(EP_mssilk_GIT_TAG "07b55ce81adca894bf6bd1ed86eb27f4578562f1") # Branch 'master'
set(EP_mssilk_USE_AUTOTOOLS "yes")
set(EP_mssilk_BUILD_METHOD "autotools")
set(EP_mssilk_USE_AUTOGEN "yes")
set(EP_mssilk_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
......
......@@ -22,7 +22,7 @@
set(EP_msx264_GIT_REPOSITORY "git://git.linphone.org/msx264.git")
set(EP_msx264_GIT_TAG "6532dd845c59631a9149e9146ba5cf9426db906b") # Branch 'master'
set(EP_msx264_USE_AUTOTOOLS "yes")
set(EP_msx264_BUILD_METHOD "autotools")
set(EP_msx264_USE_AUTOGEN "yes")
set(EP_msx264_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
......
......@@ -21,7 +21,7 @@
############################################################################
set(EP_opencoreamr_URL "http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.3.tar.gz")
set(EP_opencoreamr_USE_AUTOTOOLS "yes")
set(EP_opencoreamr_BUILD_METHOD "autotools")
set(EP_opencoreamr_USE_AUTOGEN "yes")
set(EP_opencoreamr_CONFIGURE_OPTIONS )
set(EP_opencoreamr_CROSS_COMPILATION_OPTIONS
......
......@@ -21,7 +21,7 @@
############################################################################
set(EP_opus_URL "http://downloads.xiph.org/releases/opus/opus-1.0.3.tar.gz")
set(EP_opus_USE_AUTOTOOLS "yes")
set(EP_opus_BUILD_METHOD "autotools")
set(EP_opus_USE_AUTOGEN "yes")
set(EP_opus_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
......
......@@ -28,7 +28,7 @@ if(WIN32)
set(EP_ortp_DEPENDENCIES EP_srtp)
set(EP_ortp_EXTRA_LDFLAGS "/SAFESEH:NO")
else(WIN32)
set(EP_ortp_USE_AUTOTOOLS "yes")
set(EP_ortp_BUILD_METHOD "autotools")
set(EP_ortp_USE_AUTOGEN "yes")
set(EP_ortp_CONFIG_H_FILE ortp-config.h)
set(EP_ortp_CROSS_COMPILATION_OPTIONS
......
......@@ -22,7 +22,7 @@
set(EP_tunnel_GIT_REPOSITORY "gitosis@git.linphone.org:tunnel.git") # Private repository
set(EP_tunnel_GIT_TAG "e6d100c33e0147ae35cdf693dbcd7b9413cb84ef") # Branch 'master'
set(EP_tunnel_USE_AUTOTOOLS "yes")
set(EP_tunnel_BUILD_METHOD "autotools")
set(EP_tunnel_USE_AUTOGEN "yes")
set(EP_tunnel_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
......
......@@ -21,7 +21,7 @@
############################################################################
set(EP_v4l_URL "http://linuxtv.org/downloads/v4l-utils/v4l-utils-1.0.0.tar.bz2")
set(EP_v4l_USE_AUTOTOOLS "yes")
set(EP_v4l_BUILD_METHOD "autotools")
set(EP_v4l_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--host=${LINPHONE_BUILDER_TOOLCHAIN_HOST}"
......
......@@ -21,7 +21,7 @@
############################################################################
set(EP_voamrwbenc_URL "http://downloads.sourceforge.net/project/opencore-amr/vo-amrwbenc/vo-amrwbenc-0.1.3.tar.gz")
set(EP_voamrwbenc_USE_AUTOTOOLS "yes")
set(EP_voamrwbenc_BUILD_METHOD "autotools")
set(EP_voamrwbenc_USE_AUTOGEN "yes")
set(EP_voamrwbenc_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
......
......@@ -21,7 +21,7 @@
############################################################################
set(EP_vpx_URL "http://webm.googlecode.com/files/libvpx-v1.3.0.tar.bz2")
set(EP_vpx_USE_AUTOTOOLS "yes")
set(EP_vpx_BUILD_METHOD "autotools")
set(EP_vpx_CONFIG_H_FILE vpx_config.h)
set(EP_vpx_CONFIGURE_OPTIONS
"--enable-error-concealment"
......
......@@ -22,7 +22,7 @@
set(EP_x264_GIT_REPOSITORY "git://git.videolan.org/x264.git")
set(EP_x264_GIT_TAG "f6a8615ab0c922ac2cb5c82c9824f6f4742b1725")
set(EP_x264_USE_AUTOTOOLS "yes")
set(EP_x264_BUILD_METHOD "autotools")
set(EP_x264_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--host=${LINPHONE_BUILDER_TOOLCHAIN_HOST}"
......
......@@ -22,7 +22,7 @@
set(EP_xml2_GIT_REPOSITORY "git://git.gnome.org/libxml2")
set(EP_xml2_GIT_TAG "v2.8.0")
set(EP_xml2_USE_AUTOTOOLS "yes")
set(EP_xml2_BUILD_METHOD "autotools")
set(EP_xml2_USE_AUTOGEN "yes")
set(EP_xml2_CONFIGURE_OPTIONS_PASSED_TO_AUTOGEN "yes")
set(EP_xml2_CROSS_COMPILATION_OPTIONS
......
......@@ -170,7 +170,7 @@ endmacro(linphone_builder_apply_toolchain_flags)
macro(linphone_builder_apply_cmake_flags_to_autotools_project PROJNAME)
if("${EP_${PROJNAME}_USE_AUTOTOOLS}" STREQUAL "yes")
if("${EP_${PROJNAME}_BUILD_METHOD}" STREQUAL "autotools")
if(NOT MSVC)
set(BUILD_TYPES "Debug" "Release" "RelWithDebInfo" "MinSizeRel")
list(FIND BUILD_TYPES "${CMAKE_BUILD_TYPE}" BUILD_TYPE_FOUND)
......@@ -185,18 +185,18 @@ macro(linphone_builder_apply_cmake_flags_to_autotools_project PROJNAME)
set(ep_cxxflags "${CMAKE_CXX_FLAGS${BUILD_TYPE_SUFFIX}}")
set(ep_ldflags "${CMAKE_LD_FLAGS${BUILD_TYPE_SUFFIX}}")
endif(NOT MSVC)
endif("${EP_${PROJNAME}_USE_AUTOTOOLS}" STREQUAL "yes")
endif()
endmacro(linphone_builder_apply_cmake_flags_to_autotools_project)
macro(linphone_builder_apply_extra_flags PROJNAME)
if("${EP_${PROJNAME}_USE_AUTOTOOLS}" STREQUAL "yes")
if("${EP_${PROJNAME}_BUILD_METHOD}" STREQUAL "autotools")
set(ep_extra_asflags ${EP_${PROJNAME}_EXTRA_ASFLAGS})
set(ep_extra_cppflags ${EP_${PROJNAME}_EXTRA_CPPFLAGS})
set(ep_extra_cflags ${EP_${PROJNAME}_EXTRA_CFLAGS})
set(ep_extra_cxxflags ${EP_${PROJNAME}_EXTRA_CXXFLAGS})
set(ep_extra_ldflags ${EP_${PROJNAME}_EXTRA_LDFLAGS})
else("${EP_${PROJNAME}_USE_AUTOTOOLS}" STREQUAL "yes")
else()
foreach(BUILD_CONFIG "" "_DEBUG" "_MINSIZEREL" "_RELEASE" "_RELWITHDEBINFO")
if(NOT "${EP_${PROJNAME}_EXTRA_CFLAGS}" STREQUAL "")
set(CMAKE_C_FLAGS${BUILD_CONFIG} "${CMAKE_C_FLAGS${BUILD_CONFIG}} ${EP_${PROJNAME}_EXTRA_CFLAGS}")
......@@ -210,7 +210,7 @@ macro(linphone_builder_apply_extra_flags PROJNAME)
set(CMAKE_SHARED_LINKER_FLAGS${BUILD_CONFIG} "${CMAKE_SHARED_LINKER_FLAGS${BUILD_CONFIG}} ${EP_${PROJNAME}_EXTRA_LDFLAGS}")
endif(NOT "${EP_${PROJNAME}_EXTRA_LDFLAGS}" STREQUAL "")
endforeach(BUILD_CONFIG)
endif("${EP_${PROJNAME}_USE_AUTOTOOLS}" STREQUAL "yes")
endif()
endmacro(linphone_builder_apply_extra_flags)
......@@ -260,7 +260,13 @@ function(linphone_builder_add_project PROJNAME)
linphone_builder_apply_extra_flags(${PROJNAME})
linphone_builder_expand_external_project_vars()
if("${EP_${PROJNAME}_USE_AUTOTOOLS}" STREQUAL "yes")
if("${EP_${PROJNAME}_BUILD_METHOD}" STREQUAL "custom")
set(BUILD_COMMANDS
CONFIGURE_COMMAND ${EP_${PROJNAME}_CONFIGURE_COMMAND}
BUILD_COMMAND ${EP_${PROJNAME}_BUILD_COMMAND}
INSTALL_COMMAND ${EP_${PROJNAME}_INSTALL_COMMAND}
)
elseif("${EP_${PROJNAME}_BUILD_METHOD}" STREQUAL "autotools")
linphone_builder_create_autogen_command(${PROJNAME})
linphone_builder_create_configure_command(${PROJNAME})
if("${EP_${PROJNAME}_CONFIG_H_FILE}" STREQUAL "")
......@@ -302,7 +308,8 @@ function(linphone_builder_add_project PROJNAME)
BUILD_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_build.${SCRIPT_EXTENSION}
INSTALL_COMMAND ${CMAKE_CURRENT_BINARY_DIR}/EP_${PROJNAME}_install.${SCRIPT_EXTENSION}
)
else("${EP_${PROJNAME}_USE_AUTOTOOLS}" STREQUAL "yes")
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}
......@@ -313,7 +320,7 @@ function(linphone_builder_add_project PROJNAME)
CMAKE_ARGS ${LINPHONE_BUILDER_EP_ARGS} ${EP_${PROJNAME}_CMAKE_OPTIONS} ${EP_${PROJNAME}_LINKING_TYPE}
)
endif("${CMAKE_VERSION}" VERSION_GREATER "2.8.3")
endif("${EP_${PROJNAME}_USE_AUTOTOOLS}" STREQUAL "yes")
endif()
if(NOT "${EP_${PROJNAME}_URL}" STREQUAL "")
set(DOWNLOAD_SOURCE URL ${EP_${PROJNAME}_URL})
......@@ -332,14 +339,14 @@ function(linphone_builder_add_project PROJNAME)
)
if(MSVC)
if("${EP_${PROJNAME}_USE_AUTOTOOLS}" STREQUAL "yes")
if("${EP_${PROJNAME}_BUILD_METHOD}" STREQUAL "autotools")
ExternalProject_Add_Step(EP_${PROJNAME} postinstall
COMMAND ${CMAKE_COMMAND} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DINSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -P ${CMAKE_CURRENT_SOURCE_DIR}/builders/${PROJNAME}/postinstall.cmake
COMMENT "Performing post-installation step"
DEPENDEES mkdir update patch download configure build install
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
endif("${EP_${PROJNAME}_USE_AUTOTOOLS}" STREQUAL "yes")
endif()
endif(MSVC)
endfunction(linphone_builder_add_project)
......
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