Commit 8ae96c1a authored by Ghislain MARY's avatar Ghislain MARY

Add support of build for Windows 10.

parent 4b3687ed
......@@ -71,8 +71,8 @@ else()
linphone_builder_apply_flags()
# Get build tools and flags for autotools projects (except for Windows Phone where we cannot build with MinGW)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
# Get build tools and flags for autotools projects (except for Windows Phone and Windows Store where we cannot build with MinGW)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
linphone_builder_get_autotools_configuration()
endif()
......
......@@ -175,6 +175,9 @@ else()
if(ENABLE_VIDEO AND (CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone"))
linphone_builder_add_builder_to_target(TARGET_ms2plugins mswp8vid)
endif()
if(ENABLE_VIDEO AND (CMAKE_SYSTEM_NAME STREQUAL "WindowsStore"))
linphone_builder_add_builder_to_target(TARGET_ms2plugins mswinrtvid)
endif()
endif()
......
......@@ -32,6 +32,9 @@ endif()
if(EP_ffmpeg_PREBUILT)
set(EP_ffmpeg_URL "${CMAKE_CURRENT_BINARY_DIR}/${EP_ffmpeg_FILENAME}")
set(EP_ffmpeg_BUILD_METHOD "prebuilt")
elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
# Use prebuilt library in the source tree for Windows 10
set(EP_ffmpeg_EXTERNAL_SOURCE_PATHS "build/ffmpeg")
else()
if(WIN32)
set(EP_ffmpeg_PATCH_OPTIONS "--binary")
......
......@@ -22,4 +22,5 @@
set(EP_matroska2_GIT_REPOSITORY "git://git.linphone.org/libmatroska-c.git" CACHE STRING "matroska2 repository URL")
set(EP_matroska2_GIT_TAG_LATEST "bc" CACHE STRING "matroska2 tag to use when compiling latest version")
set(EP_matroska2_GIT_TAG "97fed78cf55b05546bf13ae209843fa9cd704c8e" CACHE STRING "matroska2 tag to use")
set(EP_matroska2_GIT_TAG "b5254a96518b962a9738aa6c6f7dc28b5f312793" CACHE STRING "matroska2 tag to use")
set(EP_matroska2_EXTERNAL_SOURCE_PATHS "matroska")
############################################################################
# mswinrtvid.cmake
# Copyright (C) 2016 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.
#
############################################################################
set(EP_mswinrtvid_GIT_REPOSITORY "git://git.linphone.org/mswinrtid.git" CACHE STRING "mswinrtvid repository URL")
set(EP_mswinrtvid_GIT_TAG_LATEST "master" CACHE STRING "mswinrtvid tag to use when compiling latest version")
set(EP_mswinrtvid_GIT_TAG "b067bca955dc170b54fffe019a6a7ce86c781c8a" CACHE STRING "mswinrtvid tag to use")
set(EP_mswinrtvid_EXTERNAL_SOURCE_PATHS "mswinrtvid")
set(EP_mswinrtvid_GROUPABLE YES)
set(EP_mswinrtvid_LINKING_TYPE "${DEFAULT_VALUE_CMAKE_LINKING_TYPE}")
set(EP_mswinrtvid_DEPENDENCIES EP_ms2)
......@@ -35,7 +35,7 @@ if(EP_opencoreamr_PREBUILT)
else()
set(EP_opencoreamr_URL "http://downloads.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.3.tar.gz")
set(EP_opencoreamr_URL_HASH "MD5=09d2c5dfb43a9f6e9fec8b1ae678e725")
set(EP_opencoreamr_EXTERNAL_SOURCE_PATHS "externals/opencore-amr")
set(EP_opencoreamr_EXTERNAL_SOURCE_PATHS "externals/opencore-amr" "opencore-amr")
set(EP_opencoreamr_PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/opencoreamr/CMakeLists.txt" "<SOURCE_DIR>")
set(EP_opencoreamr_LINKING_TYPE "-DENABLE_STATIC=YES")
......
......@@ -20,56 +20,61 @@
#
############################################################################
find_program(NASM_PROGRAM
NAMES nasm nasm.exe
HINTS "${LINPHONE_BUILDER_WORK_DIR}/windows_tools"
)
if(NOT NASM_PROGRAM)
if(WIN32)
message(FATAL_ERROR "Could not find the nasm.exe program. Please install it from http://www.nasm.us/")
else()
message(FATAL_ERROR "Could not find the nasm program.")
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
# Use prebuilt library in the source tree for Windows 10
set(EP_openh264_EXTERNAL_SOURCE_PATHS "build/openh264")
else()
find_program(NASM_PROGRAM
NAMES nasm nasm.exe
HINTS "${LINPHONE_BUILDER_WORK_DIR}/windows_tools"
)
if(NOT NASM_PROGRAM)
if(WIN32)
message(FATAL_ERROR "Could not find the nasm.exe program. Please install it from http://www.nasm.us/")
else()
message(FATAL_ERROR "Could not find the nasm program.")
endif()
endif()
endif()
set(EP_openh264_VERSION "1.5.0") # Keep this variable, it is used for packaging to know the version to download from Cisco
set(EP_openh264_GIT_REPOSITORY "https://github.com/cisco/openh264" CACHE STRING "openh264 repository URL")
set(EP_openh264_GIT_TAG "v${EP_openh264_VERSION}" CACHE STRING "openh264 tag to use")
set(EP_openh264_EXTERNAL_SOURCE_PATHS "externals/openh264")
set(EP_openh264_VERSION "1.5.0") # Keep this variable, it is used for packaging to know the version to download from Cisco
set(EP_openh264_GIT_REPOSITORY "https://github.com/cisco/openh264" CACHE STRING "openh264 repository URL")
set(EP_openh264_GIT_TAG "v${EP_openh264_VERSION}" CACHE STRING "openh264 tag to use")
set(EP_openh264_EXTERNAL_SOURCE_PATHS "externals/openh264")
set(EP_openh264_BUILD_METHOD "custom")
set(EP_openh264_LINKING_TYPE "-static")
set(EP_openh264_BUILD_TYPE "Release") # Always use Release build type, otherwise the codec is too slow...
set(EP_openh264_CONFIGURE_COMMAND_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/builders/openh264/configure.sh.cmake)
set(EP_openh264_BUILD_COMMAND_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/builders/openh264/build.sh.cmake)
set(EP_openh264_INSTALL_COMMAND_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/builders/openh264/install.sh.cmake)
if (MSVC)
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"msvc\"")
endif()
if (APPLE)
if(IOS)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"ios\" ARCH=\"arm64\"")
#XCode7 allows bitcode
if (NOT ${XCODE_VERSION} VERSION_LESS 7)
set(EP_openh264_EXTRA_CFLAGS "-fembed-bitcode")
endif()
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7")
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"ios\" ARCH=\"armv7\"")
#XCode7 allows bitcode
if (NOT ${XCODE_VERSION} VERSION_LESS 7)
set(EP_openh264_EXTRA_CFLAGS "-fembed-bitcode")
set(EP_openh264_BUILD_METHOD "custom")
set(EP_openh264_LINKING_TYPE "-static")
set(EP_openh264_BUILD_TYPE "Release") # Always use Release build type, otherwise the codec is too slow...
set(EP_openh264_CONFIGURE_COMMAND_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/builders/openh264/configure.sh.cmake)
set(EP_openh264_BUILD_COMMAND_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/builders/openh264/build.sh.cmake)
set(EP_openh264_INSTALL_COMMAND_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/builders/openh264/install.sh.cmake)
if (MSVC)
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"msvc\"")
endif()
if (APPLE)
if(IOS)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"ios\" ARCH=\"arm64\"")
#XCode7 allows bitcode
if (NOT ${XCODE_VERSION} VERSION_LESS 7)
set(EP_openh264_EXTRA_CFLAGS "-fembed-bitcode")
endif()
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7")
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"ios\" ARCH=\"armv7\"")
#XCode7 allows bitcode
if (NOT ${XCODE_VERSION} VERSION_LESS 7)
set(EP_openh264_EXTRA_CFLAGS "-fembed-bitcode")
endif()
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"ios\" ARCH=\"x86_64\"")
else()
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"ios\" ARCH=\"i386\"")
endif()
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"ios\" ARCH=\"x86_64\"")
else()
set(EP_openh264_ADDITIONAL_OPTIONS "OS=\"ios\" ARCH=\"i386\"")
endif()
else()
if(CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64")
set(EP_openh264_ADDITIONAL_OPTIONS "ARCH=\"x86_64\"")
else()
set(EP_openh264_ADDITIONAL_OPTIONS "ARCH=\"x86\"")
if(CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64")
set(EP_openh264_ADDITIONAL_OPTIONS "ARCH=\"x86_64\"")
else()
set(EP_openh264_ADDITIONAL_OPTIONS "ARCH=\"x86\"")
endif()
endif()
endif()
endif()
......@@ -202,10 +202,12 @@ if(OPUS_ARM_EXTERNAL_ASM)
COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/celt/arm/arm2gnu.pl" ${ARM2GNU_PARAMS} "<" "${CELT_SOURCES_ARM_ASM}" ">" "${CELT_SOURCES_EXTERNAL_ARM_ASM}")
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/celt/arm/armopts.s.in ${CMAKE_CURRENT_BINARY_DIR}/celt/arm/armopts.s @ONLY)
set(CELT_AM_SOURCES_ARM_ASM
${CMAKE_CURRENT_BINARY_DIR}/celt/arm/armopts.s
)
if(OPUS_ARM_ASM)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/celt/arm/armopts.s.in ${CMAKE_CURRENT_BINARY_DIR}/celt/arm/armopts.s @ONLY)
set(CELT_AM_SOURCES_ARM_ASM
${CMAKE_CURRENT_BINARY_DIR}/celt/arm/armopts.s
)
endif()
if(OPUS_ARM_EXTERNAL_ASM)
set(CELT_AM_SOURCES_EXTERNAL_ARM_ASM
${CMAKE_CURRENT_BINARY_DIR}/celt/arm/armopts-gnu.S
......@@ -376,8 +378,6 @@ if(ENABLE_FIXED_POINT)
list(APPEND SILK_SOURCES ${SILK_SOURCES_FIXED})
else()
list(APPEND SILK_SOURCES ${SILK_SOURCES_FLOAT})
endif()
if(ENABLE_FLOAT_API)
list(APPEND OPUS_SOURCES ${OPUS_SOURCES_FLOAT})
endif()
if(OPUS_ARM_ASM)
......@@ -386,6 +386,9 @@ if(OPUS_ARM_ASM)
list(APPEND CELT_SOURCES ${CELT_SOURCES_EXTERNAL_ARM_ASM} ${CELT_AM_SOURCES_EXTERNAL_ARM_ASM})
endif()
endif()
if(MSVC AND CMAKE_GENERATOR MATCHES "^.* ARM")
add_definitions(-DNO_INLINE_ASM)
endif()
if(ENABLE_STATIC)
......@@ -404,6 +407,9 @@ else()
endif()
target_compile_options(opus PRIVATE "-w")
target_compile_definitions(opus PRIVATE "-DHAVE_CONFIG_H")
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set_source_files_properties(src/opus_decoder.c PROPERTIES COMPILE_FLAGS "/wd4703")
endif()
install(TARGETS opus
RUNTIME DESTINATION bin
......
......@@ -32,7 +32,7 @@ if(WIN32)
list(APPEND SOURCE_FILES sqlite3.def)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
add_definitions(
-DSQLITE_OS_WINRT=1
-DSQLITE_WIN32_FILEMAPPING_API=1
......
......@@ -35,7 +35,7 @@ if(EP_voamrwbenc_PREBUILT)
else()
set(EP_voamrwbenc_URL "http://downloads.sourceforge.net/project/opencore-amr/vo-amrwbenc/vo-amrwbenc-0.1.3.tar.gz")
set(EP_voamrwbenc_URL_HASH "MD5=f63bb92bde0b1583cb3cb344c12922e0")
set(EP_voamrwbenc_EXTERNAL_SOURCE_PATHS "externals/vo-amrwbenc")
set(EP_voamrwbenc_EXTERNAL_SOURCE_PATHS "externals/vo-amrwbenc" "vo-amrwbenc")
set(EP_voamrwbenc_PATCH_COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/voamrwbenc/CMakeLists.txt" "<SOURCE_DIR>")
set(EP_voamrwbenc_LINKING_TYPE "-DENABLE_STATIC=YES")
......
......@@ -32,6 +32,9 @@ endif()
if(EP_vpx_PREBUILT)
set(EP_vpx_URL "${CMAKE_CURRENT_BINARY_DIR}/${EP_vpx_FILENAME}")
set(EP_vpx_BUILD_METHOD "prebuilt")
elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
# Use prebuilt library in the source tree for Windows 10
set(EP_vpx_EXTERNAL_SOURCE_PATHS "build/libvpx")
else()
set(EP_vpx_URL "http://storage.googleapis.com/downloads.webmproject.org/releases/webm/libvpx-1.5.0.tar.bz2")
set(EP_vpx_URL_HASH "MD5=49e59dd184caa255886683facea56fca")
......
......@@ -42,5 +42,7 @@ else()
list(APPEND EP_xml2_PATCH_COMMAND "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/xml2/config.h.cmake" "<SOURCE_DIR>")
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
list(APPEND EP_xml2_PATCH_COMMAND "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/xml2/windowsphone_port.h" "<SOURCE_DIR>")
elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
list(APPEND EP_xml2_PATCH_COMMAND "COMMAND" "${CMAKE_COMMAND}" "-E" "copy" "${CMAKE_CURRENT_SOURCE_DIR}/builders/xml2/universal_windows_port.h" "<SOURCE_DIR>")
endif()
endif()
......@@ -364,6 +364,8 @@ elseif(NOT APPLE)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
target_compile_options(xml2 PRIVATE "/FIwindowsphone_port.h")
elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
target_compile_options(xml2 PRIVATE "/FIuniversal_windows_port.h")
endif()
install(TARGETS xml2
......
#ifndef LIBXML2_PORT_H
#define LIBXML2_PORT_H
#define GetVersionEx(osvi) (((osvi)->dwPlatformId = 0) != 0)
#define getcwd(a, b) NULL
#define getenv(x) NULL
#endif /* LIBXML2_PORT_H */
......@@ -102,6 +102,7 @@ list(APPEND LINPHONE_BUILDER_EP_VARS
CMAKE_MODULE_PATH:PATH
CMAKE_NO_BUILD_TYPE:BOOL
CMAKE_PREFIX_PATH:STRING
CMAKE_PROGRAM_PATH:STRING
CMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING
......@@ -128,6 +129,13 @@ if(APPLE)
CMAKE_OSX_DEPLOYMENT_TARGET:STRING
)
endif()
if(MSVC)
if(CMAKE_VERSION VERSION_GREATER "3.3")
list(APPEND LINPHONE_BUILDER_EP_VARS
CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD:BOOL
)
endif()
endif()
if(CMAKE_TOOLCHAIN_FILE)
list(APPEND LINPHONE_BUILDER_EP_VARS CMAKE_TOOLCHAIN_FILE:PATH)
endif()
......
......@@ -25,7 +25,13 @@ if(NOT PYTHONINTERP_FOUND)
message(FATAL_ERROR "Could not find python!")
endif()
if(MSVC)
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set(WINDOWS_UNIVERSAL TRUE)
else()
set(WINDOWS_UNIVERSAL FALSE)
endif()
if(MSVC AND NOT WINDOWS_UNIVERSAL)
find_program(SH_PROGRAM
NAMES sh.exe
HINTS "C:/MinGW/msys/1.0/bin"
......@@ -34,41 +40,34 @@ if(MSVC)
message(FATAL_ERROR "Could not find MinGW!")
endif()
if(NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
find_file(GCC_LIBRARY
NAMES libgcc.a
HINTS "C:/MinGW/lib/gcc/mingw32/*"
)
execute_process(COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${GCC_LIBRARY}" "${CMAKE_INSTALL_PREFIX}/lib/gcc.lib")
find_file(MINGWEX_LIBRARY
NAMES libmingwex.a
HINTS "C:/MinGW/lib"
)
execute_process(COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${MINGWEX_LIBRARY}" "${CMAKE_INSTALL_PREFIX}/lib/mingwex.lib")
endif()
find_file(GCC_LIBRARY
NAMES libgcc.a
HINTS "C:/MinGW/lib/gcc/mingw32/*"
)
execute_process(COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${GCC_LIBRARY}" "${CMAKE_INSTALL_PREFIX}/lib/gcc.lib")
find_file(MINGWEX_LIBRARY
NAMES libmingwex.a
HINTS "C:/MinGW/lib"
)
execute_process(COMMAND "${CMAKE_COMMAND}" "-E" "copy" "${MINGWEX_LIBRARY}" "${CMAKE_INSTALL_PREFIX}/lib/mingwex.lib")
endif()
if(WIN32)
set(_windows_tools_dir ${CMAKE_BINARY_DIR}/windows_tools)
file(MAKE_DIRECTORY ${_windows_tools_dir})
set(CMAKE_PROGRAM_PATH "${CMAKE_BINARY_DIR}/programs")
file(MAKE_DIRECTORY ${CMAKE_PROGRAM_PATH})
if(NOT EXISTS "${CMAKE_BINARY_DIR}/linphone_builder_windows_tools.zip")
message(STATUS "Installing windows tools")
file(DOWNLOAD https://www.linphone.org/files/linphone_builder_windows_tools.zip "${CMAKE_BINARY_DIR}/linphone_builder_windows_tools.zip")
execute_process(
COMMAND "${CMAKE_COMMAND}" "-E" "tar" "x" "${CMAKE_BINARY_DIR}/linphone_builder_windows_tools.zip"
WORKING_DIRECTORY ${_windows_tools_dir}
WORKING_DIRECTORY ${CMAKE_PROGRAM_PATH}
)
file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/bin")
file(RENAME "${_windows_tools_dir}/awk.exe" "${CMAKE_INSTALL_PREFIX}/bin/awk.exe")
file(RENAME "${_windows_tools_dir}/nasm.exe" "${CMAKE_INSTALL_PREFIX}/bin/nasm.exe")
file(RENAME "${_windows_tools_dir}/patch.exe" "${CMAKE_INSTALL_PREFIX}/bin/patch.exe")
file(RENAME "${_windows_tools_dir}/sed.exe" "${CMAKE_INSTALL_PREFIX}/bin/sed.exe")
file(RENAME "${_windows_tools_dir}/bunzip2.exe" "${CMAKE_INSTALL_PREFIX}/bin/bunzip2.exe")
file(RENAME "${_windows_tools_dir}/bzip2.dll" "${CMAKE_INSTALL_PREFIX}/bin/bzip2.dll")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
file(RENAME "${_windows_tools_dir}/yasm-1.3.0-win64.exe" "C:/MinGW/bin/yasm.exe")
else()
file(RENAME "${_windows_tools_dir}/yasm-1.3.0-win32.exe" "C:/MinGW/bin/yasm.exe")
if(NOT WINDOWS_UNIVERSAL)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
file(RENAME "${CMAKE_PROGRAM_PATH}/yasm-1.3.0-win64.exe" "C:/MinGW/bin/yasm.exe")
else()
file(RENAME "${CMAKE_PROGRAM_PATH}/yasm-1.3.0-win32.exe" "C:/MinGW/bin/yasm.exe")
endif()
endif()
endif()
endif()
......@@ -100,91 +99,93 @@ find_program(PKG_CONFIG_PROGRAM
HINTS "C:/MinGW/bin"
)
if(NOT PKG_CONFIG_PROGRAM)
if(WIN32)
message(STATUS "Installing pkg-config to C:/MinGW/bin")
set(_pkg_config_dir ${CMAKE_BINARY_DIR}/pkg-config)
file(MAKE_DIRECTORY ${_pkg_config_dir})
file(DOWNLOAD http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.26-1_win32.zip "${CMAKE_BINARY_DIR}/pkg-config.zip")
execute_process(
COMMAND "${CMAKE_COMMAND}" "-E" "tar" "x" "${CMAKE_BINARY_DIR}/pkg-config.zip"
WORKING_DIRECTORY ${_pkg_config_dir}
)
file(DOWNLOAD http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config-dev_0.26-1_win32.zip "${CMAKE_BINARY_DIR}/pkg-config-dev.zip")
execute_process(
COMMAND "${CMAKE_COMMAND}" "-E" "tar" "x" "${CMAKE_BINARY_DIR}/pkg-config-dev.zip"
WORKING_DIRECTORY ${_pkg_config_dir}
)
file(DOWNLOAD http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime_0.18.1.1-2_win32.zip "${CMAKE_BINARY_DIR}/gettext-runtime.zip")
execute_process(
COMMAND "${CMAKE_COMMAND}" "-E" "tar" "x" "${CMAKE_BINARY_DIR}/gettext-runtime.zip"
WORKING_DIRECTORY ${_pkg_config_dir}
)
file(DOWNLOAD http://ftp.acc.umu.se/pub/gnome/binaries/win32/glib/2.28/glib_2.28.8-1_win32.zip "${CMAKE_BINARY_DIR}/glib.zip")
execute_process(
COMMAND "${CMAKE_COMMAND}" "-E" "tar" "x" "${CMAKE_BINARY_DIR}/glib.zip"
WORKING_DIRECTORY ${_pkg_config_dir}
if(NOT WINDOWS_UNIVERSAL)
if(NOT PKG_CONFIG_PROGRAM)
if(WIN32)
message(STATUS "Installing pkg-config to C:/MinGW/bin")
set(_pkg_config_dir ${CMAKE_BINARY_DIR}/pkg-config)
file(MAKE_DIRECTORY ${_pkg_config_dir})
file(DOWNLOAD http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config_0.26-1_win32.zip "${CMAKE_BINARY_DIR}/pkg-config.zip")
execute_process(
COMMAND "${CMAKE_COMMAND}" "-E" "tar" "x" "${CMAKE_BINARY_DIR}/pkg-config.zip"
WORKING_DIRECTORY ${_pkg_config_dir}
)
file(DOWNLOAD http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/pkg-config-dev_0.26-1_win32.zip "${CMAKE_BINARY_DIR}/pkg-config-dev.zip")
execute_process(
COMMAND "${CMAKE_COMMAND}" "-E" "tar" "x" "${CMAKE_BINARY_DIR}/pkg-config-dev.zip"
WORKING_DIRECTORY ${_pkg_config_dir}
)
file(DOWNLOAD http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/gettext-runtime_0.18.1.1-2_win32.zip "${CMAKE_BINARY_DIR}/gettext-runtime.zip")
execute_process(
COMMAND "${CMAKE_COMMAND}" "-E" "tar" "x" "${CMAKE_BINARY_DIR}/gettext-runtime.zip"
WORKING_DIRECTORY ${_pkg_config_dir}
)
file(DOWNLOAD http://ftp.acc.umu.se/pub/gnome/binaries/win32/glib/2.28/glib_2.28.8-1_win32.zip "${CMAKE_BINARY_DIR}/glib.zip")
execute_process(
COMMAND "${CMAKE_COMMAND}" "-E" "tar" "x" "${CMAKE_BINARY_DIR}/glib.zip"
WORKING_DIRECTORY ${_pkg_config_dir}
)
file(RENAME "${_pkg_config_dir}/bin/pkg-config.exe" "C:/MinGW/bin/pkg-config.exe")
file(RENAME "${_pkg_config_dir}/share/aclocal/pkg.m4" "C:/MinGW/share/aclocal/pkg.m4")
file(RENAME "${_pkg_config_dir}/bin/libglib-2.0-0.dll" "C:/MinGW/bin/libglib-2.0-0.dll")
file(RENAME "${_pkg_config_dir}/bin/intl.dll" "C:/MinGW/bin/intl.dll")
unset(_pkg_config_dir)
endif()
find_program(PKG_CONFIG_PROGRAM
NAMES pkg-config pkg-config.exe
HINTS "C:/MinGW/bin"
)
file(RENAME "${_pkg_config_dir}/bin/pkg-config.exe" "C:/MinGW/bin/pkg-config.exe")
file(RENAME "${_pkg_config_dir}/share/aclocal/pkg.m4" "C:/MinGW/share/aclocal/pkg.m4")
file(RENAME "${_pkg_config_dir}/bin/libglib-2.0-0.dll" "C:/MinGW/bin/libglib-2.0-0.dll")
file(RENAME "${_pkg_config_dir}/bin/intl.dll" "C:/MinGW/bin/intl.dll")
unset(_pkg_config_dir)
endif()
find_program(PKG_CONFIG_PROGRAM
NAMES pkg-config pkg-config.exe
HINTS "C:/MinGW/bin"
)
endif()
if(NOT PKG_CONFIG_PROGRAM AND NOT MSVC)
message(FATAL_ERROR "Could not find the pkg-config program.")
endif()
find_program(INTLTOOLIZE_PROGRAM
NAMES intltoolize
HINTS "C:/MinGW/msys/1.0/bin"
)
if(NOT INTLTOOLIZE_PROGRAM)
if(WIN32)
message(STATUS "Installing intltoolize to C:/MinGW/bin")
set(_intltoolize_dir ${CMAKE_BINARY_DIR}/intltoolize)
file(MAKE_DIRECTORY ${_intltoolize_dir})
file(DOWNLOAD http://ftp.gnome.org/pub/gnome/binaries/win32/intltool/0.40/intltool_0.40.4-1_win32.zip "${CMAKE_BINARY_DIR}/intltoolize.zip")
execute_process(
COMMAND "${CMAKE_COMMAND}" "-E" "tar" "x" "${CMAKE_BINARY_DIR}/intltoolize.zip"
WORKING_DIRECTORY ${_intltoolize_dir}
)
execute_process(
COMMAND "${SED_PROGRAM}" "-i" "s;/opt/perl/bin/perl;/bin/perl;g" "${_intltoolize_dir}/bin/intltool-extract"
COMMAND "${SED_PROGRAM}" "-i" "s;/opt/perl/bin/perl;/bin/perl;g" "${_intltoolize_dir}/bin/intltool-merge"
COMMAND "${SED_PROGRAM}" "-i" "s;/opt/perl/bin/perl;/bin/perl;g" "${_intltoolize_dir}/bin/intltool-prepare"
COMMAND "${SED_PROGRAM}" "-i" "s;/opt/perl/bin/perl;/bin/perl;g" "${_intltoolize_dir}/bin/intltool-update"
)
file(RENAME "${_intltoolize_dir}/bin/intltoolize" "C:/MinGW/msys/1.0/bin/intltoolize")
file(RENAME "${_intltoolize_dir}/bin/intltool-extract" "C:/MinGW/bin/intltool-extract")
file(RENAME "${_intltoolize_dir}/bin/intltool-merge" "C:/MinGW/bin/intltool-merge")
file(RENAME "${_intltoolize_dir}/bin/intltool-prepare" "C:/MinGW/bin/intltool-prepare")
file(RENAME "${_intltoolize_dir}/bin/intltool-update" "C:/MinGW/bin/intltool-update")
file(RENAME "${_intltoolize_dir}/share/aclocal/intltool.m4" "C:/MinGW/share/aclocal/intltool.m4")
file(MAKE_DIRECTORY "C:/MinGW/msys/1.0/share/intltool")
file(RENAME "${_intltoolize_dir}/share/intltool/Makefile.in.in" "C:/MinGW/msys/1.0/share/intltool/Makefile.in.in")
unset(_intltoolize_dir)
if(NOT PKG_CONFIG_PROGRAM AND NOT MSVC)
message(FATAL_ERROR "Could not find the pkg-config program.")
endif()
find_program(INTLTOOLIZE_PROGRAM
NAMES intltoolize
HINTS "C:/MinGW/msys/1.0/bin"
)
endif()
if(NOT INTLTOOLIZE_PROGRAM AND NOT MSVC)
message(FATAL_ERROR "Could not find the intltoolize program.")
if(NOT INTLTOOLIZE_PROGRAM)
if(WIN32)
message(STATUS "Installing intltoolize to C:/MinGW/bin")
set(_intltoolize_dir ${CMAKE_BINARY_DIR}/intltoolize)
file(MAKE_DIRECTORY ${_intltoolize_dir})
file(DOWNLOAD http://ftp.gnome.org/pub/gnome/binaries/win32/intltool/0.40/intltool_0.40.4-1_win32.zip "${CMAKE_BINARY_DIR}/intltoolize.zip")
execute_process(
COMMAND "${CMAKE_COMMAND}" "-E" "tar" "x" "${CMAKE_BINARY_DIR}/intltoolize.zip"
WORKING_DIRECTORY ${_intltoolize_dir}
)
execute_process(
COMMAND "${SED_PROGRAM}" "-i" "s;/opt/perl/bin/perl;/bin/perl;g" "${_intltoolize_dir}/bin/intltool-extract"
COMMAND "${SED_PROGRAM}" "-i" "s;/opt/perl/bin/perl;/bin/perl;g" "${_intltoolize_dir}/bin/intltool-merge"
COMMAND "${SED_PROGRAM}" "-i" "s;/opt/perl/bin/perl;/bin/perl;g" "${_intltoolize_dir}/bin/intltool-prepare"
COMMAND "${SED_PROGRAM}" "-i" "s;/opt/perl/bin/perl;/bin/perl;g" "${_intltoolize_dir}/bin/intltool-update"
)
file(RENAME "${_intltoolize_dir}/bin/intltoolize" "C:/MinGW/msys/1.0/bin/intltoolize")
file(RENAME "${_intltoolize_dir}/bin/intltool-extract" "C:/MinGW/bin/intltool-extract")
file(RENAME "${_intltoolize_dir}/bin/intltool-merge" "C:/MinGW/bin/intltool-merge")
file(RENAME "${_intltoolize_dir}/bin/intltool-prepare" "C:/MinGW/bin/intltool-prepare")
file(RENAME "${_intltoolize_dir}/bin/intltool-update" "C:/MinGW/bin/intltool-update")
file(RENAME "${_intltoolize_dir}/share/aclocal/intltool.m4" "C:/MinGW/share/aclocal/intltool.m4")
file(MAKE_DIRECTORY "C:/MinGW/msys/1.0/share/intltool")
file(RENAME "${_intltoolize_dir}/share/intltool/Makefile.in.in" "C:/MinGW/msys/1.0/share/intltool/Makefile.in.in")
unset(_intltoolize_dir)
endif()
find_program(INTLTOOLIZE_PROGRAM
NAMES intltoolize
HINTS "C:/MinGW/msys/1.0/bin"
)
endif()
if(NOT INTLTOOLIZE_PROGRAM AND NOT MSVC)
message(FATAL_ERROR "Could not find the intltoolize program.")
endif()
endif()
if(MSVC)
if(MSVC AND NOT WINDOWS_UNIVERSAL)
# Install headers needed by MSVC
file(GLOB MSVC_HEADER_FILES "${CMAKE_CURRENT_SOURCE_DIR}/cmake/MSVC/*.h")
file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/include/MSVC")
......
############################################################################
# config-windowsphone.cmake
# Copyright (C) 2015 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.
#
############################################################################
# Define default values for the linphone builder options
set(DEFAULT_VALUE_ENABLE_DTLS ON)
set(DEFAULT_VALUE_ENABLE_FFMPEG ON)
set(DEFAULT_VALUE_ENABLE_GPL_THIRD_PARTIES ON)
set(DEFAULT_VALUE_ENABLE_GSM ON)
set(DEFAULT_VALUE_ENABLE_ILBC ON)
set(DEFAULT_VALUE_ENABLE_ISAC ON)
set(DEFAULT_VALUE_ENABLE_MKV ON)
set(DEFAULT_VALUE_ENABLE_OPUS ON)
set(DEFAULT_VALUE_ENABLE_SILK ON)
set(DEFAULT_VALUE_ENABLE_SPEEX ON)
set(DEFAULT_VALUE_ENABLE_SRTP ON)
set(DEFAULT_VALUE_ENABLE_UNIT_TESTS ON)
set(DEFAULT_VALUE_ENABLE_VIDEO ON)
set(DEFAULT_VALUE_ENABLE_VPX ON)
set(DEFAULT_VALUE_ENABLE_WASAPI ON)
set(DEFAULT_VALUE_ENABLE_WEBRTC_AEC ON)
set(DEFAULT_VALUE_ENABLE_ZRTP ON)
set(DEFAULT_VALUE_CMAKE_LINKING_TYPE "-DENABLE_STATIC=NO")
# Global configuration
set(LINPHONE_BUILDER_CPPFLAGS "-D_ALLOW_KEYWORD_MACROS -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS")
# Include builders
include(builders/CMakeLists.txt)
# linphone
list(APPEND EP_linphone_CMAKE_OPTIONS
"-DENABLE_RELATIVE_PREFIX=YES"
"-DENABLE_CONSOLE_UI=NO"
"-DENABLE_GTK_UI=NO"
"-DENABLE_NLS=NO"
"-DENABLE_NOTIFY=NO"
"-DENABLE_TOOLS=NO"
"-DENABLE_TUTORIALS=NO"
"-DENABLE_UPNP=NO"
)
# ms2
list(APPEND EP_ms2_CMAKE_OPTIONS
"-DENABLE_RELATIVE_PREFIX=YES"
"-DENABLE_TOOLS=NO"
)
# opus
list(APPEND EP_opus_CMAKE_OPTIONS
"-DENABLE_ASM=NO"
"-DENABLE_FIXED_POINT=YES"
)
set(EP_opus_LINKING_TYPE "-DENABLE_STATIC=YES")
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