Commit 28fbeb04 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Use CMAKE_TOOLCHAIN_FILE to specify toolchain and add...

Use CMAKE_TOOLCHAIN_FILE to specify toolchain and add LINPHONE_BUILDER_CONFIG_FILE option to specify the build configuration to use.
parent 484aaaea
......@@ -22,7 +22,10 @@
cmake_minimum_required(VERSION 2.8)
set(LINPHONE_BUILDER_TOOLCHAIN "desktop" CACHE STRING "Toolchain to use for the build.")
include(FeatureSummary)
set(LINPHONE_BUILDER_CONFIG_FILE "configs/config-desktop.cmake" CACHE STRING "Path to the linphone builder configuration file.")
set(LINPHONE_BUILDER_WORK_DIR "${CMAKE_CURRENT_SOURCE_DIR}/WORK" CACHE PATH "Working directory for the build.")
......@@ -31,13 +34,17 @@ include(cmake/LinphoneCMakeBuilder.cmake)
# Include toolchain definition
message("-- Using toolchain '${LINPHONE_BUILDER_TOOLCHAIN}'")
include(toolchains/toolchain-${LINPHONE_BUILDER_TOOLCHAIN}.cmake)
linphone_builder_apply_toolchain_flags()
if(CMAKE_TOOLCHAIN_FILE)
get_filename_component(CMAKE_TOOLCHAIN_FILE ${CMAKE_TOOLCHAIN_FILE} ABSOLUTE)
message(STATUS "Using toolchain file '${CMAKE_TOOLCHAIN_FILE}'")
endif()
# Include project configuration according to the toolchain
include(configs/config-${LINPHONE_BUILDER_TOOLCHAIN}.cmake)
get_filename_component(LINPHONE_BUILDER_CONFIG_FILE ${LINPHONE_BUILDER_CONFIG_FILE} ABSOLUTE)
message(STATUS "Using configuration file '${LINPHONE_BUILDER_CONFIG_FILE}'")
include(${LINPHONE_BUILDER_CONFIG_FILE})
linphone_builder_apply_flags()
linphone_builder_add_external_projects()
......
......@@ -40,14 +40,14 @@ build-bb10-i486:
mkdir -p OUTPUT/liblinphone-bb10-sdk && \
mkdir -p WORK/cmake-bb10-i486 && \
cd WORK/cmake-bb10-i486 && \
cmake ../.. -DLINPHONE_BUILDER_TOOLCHAIN=bb10-i486 -DCMAKE_PREFIX_PATH=../../OUTPUT/liblinphone-bb10-sdk/i486 -DCMAKE_INSTALL_PREFIX=../../OUTPUT/liblinphone-bb10-sdk/i486 $(filter -D%,$(MAKEFLAGS)) && \
cmake ../.. -DCMAKE_TOOLCHAIN_FILE=toolchains/toolchain-bb10-i486.cmake -DLINPHONE_BUILDER_CONFIG_FILE=configs/config-bb10-i486.cmake -DCMAKE_PREFIX_PATH=../../OUTPUT/liblinphone-bb10-sdk/i486 -DCMAKE_INSTALL_PREFIX=../../OUTPUT/liblinphone-bb10-sdk/i486 $(filter -D%,$(MAKEFLAGS)) && \
make -j $(NUMCPUS)
build-bb10-arm:
mkdir -p OUTPUT/liblinphone-bb10-sdk && \
mkdir -p WORK/cmake-bb10-arm && \
cd WORK/cmake-bb10-arm && \
cmake ../.. -DLINPHONE_BUILDER_TOOLCHAIN=bb10-arm -DCMAKE_PREFIX_PATH=../../OUTPUT/liblinphone-bb10-sdk/arm -DCMAKE_INSTALL_PREFIX=../../OUTPUT/liblinphone-bb10-sdk/arm $(filter -D%,$(MAKEFLAGS)) && \
cmake ../.. -DCMAKE_TOOLCHAIN_FILE=toolchains/toolchain-bb10-arm.cmake -DLINPHONE_BUILDER_CONFIG_FILE=configs/config-bb10-arm.cmake -DCMAKE_PREFIX_PATH=../../OUTPUT/liblinphone-bb10-sdk/arm -DCMAKE_INSTALL_PREFIX=../../OUTPUT/liblinphone-bb10-sdk/arm $(filter -D%,$(MAKEFLAGS)) && \
make -j $(NUMCPUS)
build-bb10: build-bb10-i486 build-bb10-arm
......@@ -68,7 +68,7 @@ help-bb10:
mkdir -p OUTPUT/liblinphone-bb10-sdk && \
mkdir -p WORK/cmake-bb10-i486 && \
cd WORK/cmake-bb10-i486 && \
cmake ../.. -DLINPHONE_BUILDER_TOOLCHAIN=bb10-i486 -DCMAKE_PREFIX_PATH=../../OUTPUT/liblinphone-bb10-sdk/i486 -DCMAKE_INSTALL_PREFIX=../../OUTPUT/liblinphone-bb10-sdk/i486 $(filter -D%,$(MAKEFLAGS)) -LH
cmake ../.. -DCMAKE_TOOLCHAIN_FILE=toolchains/toolchain-bb10-i486.cmake -DLINPHONE_BUILDER_CONFIG_FILE=configs/config-bb10-i486.cmake -DCMAKE_PREFIX_PATH=../../OUTPUT/liblinphone-bb10-sdk/i486 -DCMAKE_INSTALL_PREFIX=../../OUTPUT/liblinphone-bb10-sdk/i486 $(filter -D%,$(MAKEFLAGS)) -LH
generate-bb10-sdk: build-bb10
cd OUTPUT && \
......@@ -78,21 +78,21 @@ build-ios-i386:
mkdir -p OUTPUT/liblinphone-ios-sdk && \
mkdir -p WORK/cmake-ios-i386 && \
cd WORK/cmake-ios-i386 && \
cmake ../.. -DLINPHONE_BUILDER_TOOLCHAIN=ios-i386 -DCMAKE_PREFIX_PATH=../../OUTPUT/liblinphone-ios-sdk/i386 -DCMAKE_INSTALL_PREFIX=../../OUTPUT/liblinphone-ios-sdk/i386 $(filter -D%,$(MAKEFLAGS)) && \
cmake ../.. -DCMAKE_TOOLCHAIN_FILE=toolchains/toolchain-ios-i386.cmake -DLINPHONE_BUILDER_CONFIG_FILE=configs/config-ios-i386.cmake -DCMAKE_PREFIX_PATH=../../OUTPUT/liblinphone-ios-sdk/i386 -DCMAKE_INSTALL_PREFIX=../../OUTPUT/liblinphone-ios-sdk/i386 $(filter -D%,$(MAKEFLAGS)) && \
make -j $(NUMCPUS)
build-ios-armv7:
mkdir -p OUTPUT/liblinphone-ios-sdk && \
mkdir -p WORK/cmake-ios-armv7 && \
cd WORK/cmake-ios-armv7 && \
cmake ../.. -DLINPHONE_BUILDER_TOOLCHAIN=ios-armv7 -DCMAKE_PREFIX_PATH=../../OUTPUT/liblinphone-ios-sdk/armv7 -DCMAKE_INSTALL_PREFIX=../../OUTPUT/liblinphone-ios-sdk/armv7 $(filter -D%,$(MAKEFLAGS)) && \
cmake ../.. -DCMAKE_TOOLCHAIN_FILE=toolchains/toolchain-ios-armv7.cmake -DLINPHONE_BUILDER_CONFIG_FILE=configs/config-ios-armv7.cmake -DCMAKE_PREFIX_PATH=../../OUTPUT/liblinphone-ios-sdk/armv7 -DCMAKE_INSTALL_PREFIX=../../OUTPUT/liblinphone-ios-sdk/armv7 $(filter -D%,$(MAKEFLAGS)) && \
make -j $(NUMCPUS)
build-ios-armv7s:
mkdir -p OUTPUT/liblinphone-ios-sdk && \
mkdir -p WORK/cmake-ios-armv7s && \
cd WORK/cmake-ios-armv7s && \
cmake ../.. -DLINPHONE_BUILDER_TOOLCHAIN=ios-armv7s -DCMAKE_PREFIX_PATH=../../OUTPUT/liblinphone-ios-sdk/armv7s -DCMAKE_INSTALL_PREFIX=../../OUTPUT/liblinphone-ios-sdk/armv7s $(filter -D%,$(MAKEFLAGS)) && \
cmake ../.. -DCMAKE_TOOLCHAIN_FILE=toolchains/toolchain-ios-armv7s.cmake -DLINPHONE_BUILDER_CONFIG_FILE=configs/config-ios-armv7s.cmake -DCMAKE_PREFIX_PATH=../../OUTPUT/liblinphone-ios-sdk/armv7s -DCMAKE_INSTALL_PREFIX=../../OUTPUT/liblinphone-ios-sdk/armv7s $(filter -D%,$(MAKEFLAGS)) && \
make -j $(NUMCPUS)
build-ios: build-ios-i386 build-ios-armv7 build-ios-armv7s
......@@ -118,7 +118,7 @@ help-ios:
mkdir -p OUTPUT/liblinphone-ios-sdk && \
mkdir -p WORK/cmake-ios-i386 && \
cd WORK/cmake-ios-i386 && \
cmake ../.. -DLINPHONE_BUILDER_TOOLCHAIN=ios-i386 -DCMAKE_PREFIX_PATH=../../OUTPUT/liblinphone-ios-sdk/i386 -DCMAKE_INSTALL_PREFIX=../../OUTPUT/liblinphone-ios-sdk/i386 $(filter -D%,$(MAKEFLAGS)) -LH
cmake ../.. -DCMAKE_TOOLCHAIN_FILE=toolchains/toolchain-ios-i386.cmake -DLINPHONE_BUILDER_CONFIG_FILE=configs/config-ios-i386.cmake -DCMAKE_PREFIX_PATH=../../OUTPUT/liblinphone-ios-sdk/i386 -DCMAKE_INSTALL_PREFIX=../../OUTPUT/liblinphone-ios-sdk/i386 $(filter -D%,$(MAKEFLAGS)) -LH
generate-ios-sdk: build-ios
arm_archives=`find OUTPUT/liblinphone-ios-sdk/armv7 -name *.a` && \
......@@ -151,4 +151,3 @@ generate-ios-sdk: build-ios
veryclean:
rm -rf WORK && \
rm -rf OUTPUT
......@@ -101,6 +101,6 @@ list(APPEND LINPHONE_BUILDER_BUILDERS linphone)
# Include builders
foreach(BUILDER ${LINPHONE_BUILDER_BUILDERS})
message("-- Including builder ${BUILDER}")
message(STATUS "Including builder ${BUILDER}")
include(${CMAKE_CURRENT_SOURCE_DIR}/builders/${BUILDER}.cmake)
endforeach(BUILDER)
......@@ -26,7 +26,7 @@ set(EP_bcg729_BUILD_METHOD "autotools")
set(EP_bcg729_USE_AUTOGEN "yes")
set(EP_bcg729_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--host=${LINPHONE_BUILDER_TOOLCHAIN_HOST}"
"--host=${LINPHONE_BUILDER_HOST}"
)
set(EP_bcg729_LINKING_TYPE "--disable-static" "--enable-shared")
set(EP_bcg729_DEPENDENCIES EP_ms2)
......
......@@ -26,7 +26,7 @@ set(EP_libilbcrfc3951_BUILD_METHOD "autotools")
set(EP_libilbcrfc3951_USE_AUTOGEN "yes")
set(EP_libilbcrfc3951_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--host=${LINPHONE_BUILDER_TOOLCHAIN_HOST}"
"--host=${LINPHONE_BUILDER_HOST}"
)
set(EP_libilbcrfc3951_LINKING_TYPE "--disable-static" "--enable-shared")
......@@ -32,7 +32,7 @@ else(WIN32)
set(EP_linphone_USE_AUTOGEN "yes")
set(EP_linphone_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--host=${LINPHONE_BUILDER_TOOLCHAIN_HOST}"
"--host=${LINPHONE_BUILDER_HOST}"
)
set(EP_linphone_CONFIGURE_OPTIONS
"--disable-strict"
......
......@@ -33,7 +33,7 @@ else(WIN32)
set(EP_ms2_CONFIG_H_FILE mediastreamer-config.h)
set(EP_ms2_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--host=${LINPHONE_BUILDER_TOOLCHAIN_HOST}"
"--host=${LINPHONE_BUILDER_HOST}"
)
set(EP_ms2_CONFIGURE_OPTIONS
"--disable-strict"
......
......@@ -27,7 +27,7 @@ set(EP_msamr_USE_AUTOGEN "yes")
set(EP_msamr_CONFIGURE_OPTIONS )
set(EP_msamr_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--host=${LINPHONE_BUILDER_TOOLCHAIN_HOST}"
"--host=${LINPHONE_BUILDER_HOST}"
)
set(EP_msamr_LINKING_TYPE "--disable-static" "--enable-shared")
set(EP_msamr_DEPENDENCIES EP_ms2 EP_opencoreamr)
......
......@@ -26,7 +26,7 @@ set(EP_msilbc_BUILD_METHOD "autotools")
set(EP_msilbc_USE_AUTOGEN "yes")
set(EP_msilbc_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--host=${LINPHONE_BUILDER_TOOLCHAIN_HOST}"
"--host=${LINPHONE_BUILDER_HOST}"
)
set(EP_msilbc_LINKING_TYPE "--disable-static" "--enable-shared")
set(EP_msilbc_DEPENDENCIES EP_ms2 EP_libilbcrfc3951)
......
......@@ -26,7 +26,7 @@ set(EP_msisac_BUILD_METHOD "autotools")
set(EP_msisac_USE_AUTOGEN "yes")
set(EP_msisac_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--host=${LINPHONE_BUILDER_TOOLCHAIN_HOST}"
"--host=${LINPHONE_BUILDER_HOST}"
)
set(EP_msisac_LINKING_TYPE "--disable-static" "--enable-shared")
set(EP_msisac_DEPENDENCIES EP_ms2)
......
......@@ -26,7 +26,7 @@ set(EP_mssilk_BUILD_METHOD "autotools")
set(EP_mssilk_USE_AUTOGEN "yes")
set(EP_mssilk_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--host=${LINPHONE_BUILDER_TOOLCHAIN_HOST}"
"--host=${LINPHONE_BUILDER_HOST}"
)
set(EP_mssilk_LINKING_TYPE "--disable-static" "--enable-shared")
set(EP_mssilk_DEPENDENCIES EP_ms2)
......
......@@ -26,7 +26,7 @@ set(EP_msx264_BUILD_METHOD "autotools")
set(EP_msx264_USE_AUTOGEN "yes")
set(EP_msx264_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--host=${LINPHONE_BUILDER_TOOLCHAIN_HOST}"
"--host=${LINPHONE_BUILDER_HOST}"
)
set(EP_msx264_LINKING_TYPE "--disable-static" "--enable-shared")
set(EP_msx264_DEPENDENCIES EP_ms2 EP_x264)
......@@ -26,7 +26,7 @@ set(EP_opencoreamr_USE_AUTOGEN "yes")
set(EP_opencoreamr_CONFIGURE_OPTIONS )
set(EP_opencoreamr_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--host=${LINPHONE_BUILDER_TOOLCHAIN_HOST}"
"--host=${LINPHONE_BUILDER_HOST}"
)
set(EP_opencoreamr_LINKING_TYPE "--disable-static" "--enable-shared")
......
#!/bin/sh
export CC=@LINPHONE_BUILDER_TOOLCHAIN_CC@
export CXX=@LINPHONE_BUILDER_TOOLCHAIN_CXX@
export OBJC=@LINPHONE_BUILDER_TOOLCHAIN_OBJC@
export LD=@LINPHONE_BUILDER_TOOLCHAIN_LD@
export AR=@LINPHONE_BUILDER_TOOLCHAIN_AR@
export RANLIB=@LINPHONE_BUILDER_TOOLCHAIN_RANLIB@
export STRIP=@LINPHONE_BUILDER_TOOLCHAIN_STRIP@
export NM=@LINPHONE_BUILDER_TOOLCHAIN_NM@
export CC=@CMAKE_C_COMPILER@
export CXX=@CMAKE_CXX_COMPILER@
export OBJC=@CMAKE_C_COMPILER@
export LD=@CMAKE_LINKER@
export AR=@CMAKE_AR@
export RANLIB=@CMAKE_RANLIB@
export STRIP=@CMAKE_STRIP@
export NM=@CMAKE_NM@
export ASFLAGS="@LINPHONE_BUILDER_TOOLCHAIN_ASFLAGS@"
export CPPFLAGS="@LINPHONE_BUILDER_TOOLCHAIN_CPPFLAGS@"
export CFLAGS="@LINPHONE_BUILDER_TOOLCHAIN_CFLAGS@"
export CPPFLAGS="@LINPHONE_BUILDER_CPPFLAGS@"
export CFLAGS="@LINPHONE_BUILDER_CFLAGS@"
export CXXFLAGS="@LINPHONE_BUILD_TOOLCHAIN_CXXFLAGS@"
export OBJCFLAGS="@LINPHONE_BUILD_TOOLCHAIN_OBJCFLAGS@"
export LDFLAGS="@LINPHONE_BUILDER_TOOLCHAIN_LDFLAGS@"
export LDFLAGS="@LINPHONE_BUILDER_LDFLAGS@"
export PKG_CONFIG="@LINPHONE_BUILDER_PKG_CONFIG@"
export PKG_CONFIG_PATH="@LINPHONE_BUILDER_PKG_CONFIG_PATH@"
......
#!/bin/sh
export CC=@LINPHONE_BUILDER_TOOLCHAIN_CC@
export CXX=@LINPHONE_BUILDER_TOOLCHAIN_CXX@
export OBJC=@LINPHONE_BUILDER_TOOLCHAIN_OBJC@
export LD=@LINPHONE_BUILDER_TOOLCHAIN_LD@
export AR=@LINPHONE_BUILDER_TOOLCHAIN_AR@
export RANLIB=@LINPHONE_BUILDER_TOOLCHAIN_RANLIB@
export STRIP=@LINPHONE_BUILDER_TOOLCHAIN_STRIP@
export NM=@LINPHONE_BUILDER_TOOLCHAIN_NM@
export CC=@CMAKE_C_COMPILER@
export CXX=@CMAKE_CXX_COMPILER@
export OBJC=@CMAKE_C_COMPILER@
export LD=@CMAKE_LINKER@
export AR=@CMAKE_AR@
export RANLIB=@CMAKE_RANLIB@
export STRIP=@CMAKE_STRIP@
export NM=@CMAKE_NM@
export ASFLAGS="@LINPHONE_BUILDER_TOOLCHAIN_ASFLAGS@"
export CPPFLAGS="@LINPHONE_BUILDER_TOOLCHAIN_CPPFLAGS@"
export CFLAGS="@LINPHONE_BUILDER_TOOLCHAIN_CFLAGS@"
export CPPFLAGS="@LINPHONE_BUILDER_CPPFLAGS@"
export CFLAGS="@LINPHONE_BUILDER_CFLAGS@"
export CXXFLAGS="@LINPHONE_BUILD_TOOLCHAIN_CXXFLAGS@"
export OBJCFLAGS="@LINPHONE_BUILD_TOOLCHAIN_OBJCFLAGS@"
export LDFLAGS="@LINPHONE_BUILDER_TOOLCHAIN_LDFLAGS@"
export LDFLAGS="@LINPHONE_BUILDER_LDFLAGS@"
export PKG_CONFIG="@LINPHONE_BUILDER_PKG_CONFIG@"
export PKG_CONFIG_PATH="@LINPHONE_BUILDER_PKG_CONFIG_PATH@"
......
......@@ -25,7 +25,7 @@ set(EP_opus_BUILD_METHOD "autotools")
set(EP_opus_USE_AUTOGEN "yes")
set(EP_opus_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--host=${LINPHONE_BUILDER_TOOLCHAIN_HOST}"
"--host=${LINPHONE_BUILDER_HOST}"
)
set(EP_opus_CONFIGURE_OPTIONS
"--disable-doc"
......
......@@ -33,7 +33,7 @@ else(WIN32)
set(EP_ortp_CONFIG_H_FILE ortp-config.h)
set(EP_ortp_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--host=${LINPHONE_BUILDER_TOOLCHAIN_HOST}"
"--host=${LINPHONE_BUILDER_HOST}"
)
set(EP_ortp_CONFIGURE_OPTIONS
"--disable-strict"
......
......@@ -26,7 +26,7 @@ set(EP_tunnel_BUILD_METHOD "autotools")
set(EP_tunnel_USE_AUTOGEN "yes")
set(EP_tunnel_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--host=${LINPHONE_BUILDER_TOOLCHAIN_HOST}"
"--host=${LINPHONE_BUILDER_HOST}"
)
set(EP_tunnel_CONFIGURE_OPTIONS
"--disable-servers"
......
......@@ -24,7 +24,7 @@ set(EP_v4l_URL "http://linuxtv.org/downloads/v4l-utils/v4l-utils-1.0.0.tar.bz2")
set(EP_v4l_BUILD_METHOD "autotools")
set(EP_v4l_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--host=${LINPHONE_BUILDER_TOOLCHAIN_HOST}"
"--host=${LINPHONE_BUILDER_HOST}"
)
set(EP_v4l_CONFIGURE_OPTIONS
"--disable-v4l-utils"
......
......@@ -25,7 +25,7 @@ set(EP_voamrwbenc_BUILD_METHOD "autotools")
set(EP_voamrwbenc_USE_AUTOGEN "yes")
set(EP_voamrwbenc_CROSS_COMPILATION_OPTIONS
"--prefix=${CMAKE_INSTALL_PREFIX}"
"--host=${LINPHONE_BUILDER_TOOLCHAIN_HOST}"
"--host=${LINPHONE_BUILDER_HOST}"
)
set(EP_voamrwbenc_LINKING_TYPE "--disable-static" "--enable-shared")
set(EP_voamrwbenc_PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/voamrwbenc/autogen.sh" "<SOURCE_DIR>")
......
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