Commit 38d15bf3 authored by Ghislain MARY's avatar Ghislain MARY

Partially revert last commit and complete it because it broke autotools builds on Windows.

parent 94081993
......@@ -44,8 +44,10 @@ set(AUTOTOOLS_C_COMPILER_NO_LAUNCHER "@CMAKE_C_COMPILER@" CACHE PATH "Initial ca
set(AUTOTOOLS_CXX_COMPILER_NO_LAUNCHER "@CMAKE_CXX_COMPILER@" CACHE PATH "Initial cache" FORCE)
set(AUTOTOOLS_OBJC_COMPILER_NO_LAUNCHER "@CMAKE_C_COMPILER@" CACHE PATH "Initial cache" FORCE)
set(AUTOTOOLS_AS_FLAGS "@AUTOTOOLS_AS_FLAGS@" CACHE STRING "Initial cache" FORCE)
set(AUTOTOOLS_C_FLAGS "@AUTOTOOLS_C_FLAGS@" CACHE STRING "Initial cache" FORCE)
set(AUTOTOOLS_CPP_FLAGS "@AUTOTOOLS_CPP_FLAGS@" CACHE STRING "Initial cache" FORCE)
set(AUTOTOOLS_CXX_FLAGS "@AUTOTOOLS_CXX_FLAGS@" CACHE STRING "Initial cache" FORCE)
set(AUTOTOOLS_OBJC_FLAGS "@AUTOTOOLS_C_FLAGS@" CACHE STRING "Initial cache" FORCE)
set(AUTOTOOLS_OBJC_FLAGS "@AUTOTOOLS_OBJC_FLAGS@" CACHE STRING "Initial cache" FORCE)
set(AUTOTOOLS_LINKER_FLAGS "@AUTOTOOLS_LINKER_FLAGS@" CACHE STRING "Initial cache" FORCE)
############################################################################
# CMakeLists.txt
# Copyright (C) 2014 Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
############################################################################
cmake_minimum_required(VERSION 2.8)
configure_file(${CMAKE_SOURCE_DIR}/Autotools.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/Autotools.cmake @ONLY)
\ No newline at end of file
......@@ -134,8 +134,39 @@ endif()
function(linphone_builder_get_autotools_configuration)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/Autotools.cmake.in" "${CMAKE_BINARY_DIR}/Autotools.cmake" @ONLY)
include(${CMAKE_BINARY_DIR}/Autotools.cmake)
if(MSVC)
set(_generator "MinGW Makefiles")
else()
set(_generator "${CMAKE_GENERATOR}")
endif()
set(_autotools_command ${CMAKE_COMMAND} -G "${_generator}")
if(CMAKE_TOOLCHAIN_FILE)
list(APPEND _autotools_command "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
endif()
if(CMAKE_OSX_ARCHITECTURES)
list(APPEND _autotools_command "-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}")
endif()
if(CMAKE_C_COMPILER_LAUNCHER)
list(APPEND _autotools_command "-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}")
endif()
if(CMAKE_CXX_COMPILER_LAUNCHER)
list(APPEND _autotools_command "-DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER}")
endif()
list(APPEND _autotools_command
"-DAUTOTOOLS_AS_FLAGS=${AUTOTOOLS_AS_FLAGS}"
"-DAUTOTOOLS_C_FLAGS=${AUTOTOOLS_C_FLAGS}"
"-DAUTOTOOLS_CPP_FLAGS=${AUTOTOOLS_CPP_FLAGS}"
"-DAUTOTOOLS_CXX_FLAGS=${AUTOTOOLS_CXX_FLAGS}"
"-DAUTOTOOLS_OBJC_FLAGS=${AUTOTOOLS_OBJC_FLAGS}"
"-DAUTOTOOLS_LINKER_FLAGS=${AUTOTOOLS_LINKER_FLAGS}"
)
list(APPEND _autotools_command "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Autotools/")
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/Autotools)
execute_process(COMMAND ${_autotools_command} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/Autotools)
unset(_autotools_command)
unset(_extra_generator)
unset(_generator)
include(${CMAKE_BINARY_DIR}/Autotools/Autotools.cmake)
endfunction()
......
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