From 1e5bdca69f7676b2dbcd64f0f44f31b12b337b7c Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 13 Dec 2016 13:45:04 +0100 Subject: sync with upstream --- .../depends/windows/cmake/mingw/CMakeLists.txt | 33 ++++++++++++++++++++++ .../windows/cmake/mingw/MinGWConfig.cmake.in | 3 ++ .../windows/cmake/mingw/Toolchain_mingw32.cmake.in | 17 +++++++++++ .../addons/depends/windows/cmake/mingw/mingw.txt | 1 + .../depends/windows/cmake/mingw/mingw32-cmd.bat.in | 6 ++++ .../depends/windows/cmake/mingw/noinstall.txt | 0 .../depends/windows/cmake/msys/CMakeLists.txt | 5 ++++ .../addons/depends/windows/cmake/msys/msys.txt | 1 + .../depends/windows/cmake/msys/noinstall.txt | 0 9 files changed, 66 insertions(+) create mode 100644 project/cmake/addons/depends/windows/cmake/mingw/CMakeLists.txt create mode 100644 project/cmake/addons/depends/windows/cmake/mingw/MinGWConfig.cmake.in create mode 100644 project/cmake/addons/depends/windows/cmake/mingw/Toolchain_mingw32.cmake.in create mode 100644 project/cmake/addons/depends/windows/cmake/mingw/mingw.txt create mode 100644 project/cmake/addons/depends/windows/cmake/mingw/mingw32-cmd.bat.in create mode 100644 project/cmake/addons/depends/windows/cmake/mingw/noinstall.txt create mode 100644 project/cmake/addons/depends/windows/cmake/msys/CMakeLists.txt create mode 100644 project/cmake/addons/depends/windows/cmake/msys/msys.txt create mode 100644 project/cmake/addons/depends/windows/cmake/msys/noinstall.txt (limited to 'project/cmake/addons') diff --git a/project/cmake/addons/depends/windows/cmake/mingw/CMakeLists.txt b/project/cmake/addons/depends/windows/cmake/mingw/CMakeLists.txt new file mode 100644 index 0000000..2c2c4b8 --- /dev/null +++ b/project/cmake/addons/depends/windows/cmake/mingw/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_minimum_required(VERSION 3.1) +project(mingw) + +function(generate_mingw32_wrapper cmd) + set(CMD ${cmd}) + configure_file(${PROJECT_SOURCE_DIR}/mingw32-cmd.bat.in ${MINGW_PATH}/bin/${CMD}.bat @ONLY) +endfunction() + +get_filename_component(CORE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../../../../../../.. REALPATH) + +set(MSYS_PATH "${CORE_SOURCE_DIR}/project/BuildDependencies/msys64") +set(MINGW_PATH "${MSYS_PATH}/mingw32") + +# configure the MinGW toolchain file +configure_file(${PROJECT_SOURCE_DIR}/Toolchain_mingw32.cmake.in ${CMAKE_INSTALL_PREFIX}/Toolchain_mingw32.cmake @ONLY) + +# configure MinGWConfig.cmake +configure_file(${PROJECT_SOURCE_DIR}/MinGWConfig.cmake.in ${CMAKE_INSTALL_PREFIX}/MinGWConfig.cmake) + +# TODO: MinGW GCC 5.3.0-1 comes without cc.exe, Remove this once package is bumped to 5.3.0-p2 +# See https://github.com/Alexpux/MINGW-packages/pull/1034 +if(NOT EXISTS ${MINGW_PATH}/bin/cc.exe) + execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${MINGW_PATH}/bin/gcc.exe ${MINGW_PATH}/bin/cc.exe) +endif() + +# configure the MinGW wrapper batch scripts +generate_mingw32_wrapper("make") +generate_mingw32_wrapper("gcc") +generate_mingw32_wrapper("cc") +generate_mingw32_wrapper("g++") +generate_mingw32_wrapper("ar") +generate_mingw32_wrapper("ld") +generate_mingw32_wrapper("windres") diff --git a/project/cmake/addons/depends/windows/cmake/mingw/MinGWConfig.cmake.in b/project/cmake/addons/depends/windows/cmake/mingw/MinGWConfig.cmake.in new file mode 100644 index 0000000..2d6baa7 --- /dev/null +++ b/project/cmake/addons/depends/windows/cmake/mingw/MinGWConfig.cmake.in @@ -0,0 +1,3 @@ +set(MINGW_INCLUDE_DIRS @MINGW_PATH@/include) +set(MINGW_MAKE @MINGW_PATH@/bin/make.bat -j$ENV{NUMBER_OF_PROCESSORS}) +set(MINGW_FOUND 1) diff --git a/project/cmake/addons/depends/windows/cmake/mingw/Toolchain_mingw32.cmake.in b/project/cmake/addons/depends/windows/cmake/mingw/Toolchain_mingw32.cmake.in new file mode 100644 index 0000000..01d281d --- /dev/null +++ b/project/cmake/addons/depends/windows/cmake/mingw/Toolchain_mingw32.cmake.in @@ -0,0 +1,17 @@ +set(CMAKE_SYSTEM_VERSION 1) +set(CMAKE_SYSTEM_NAME Windows) + +set(CMAKE_FIND_ROOT_PATH @CMAKE_FIND_ROOT_PATH@ @CMAKE_INSTALL_PREFIX@ @MSYS_PATH@ @MINGW_PATH@) + +# specify the cross compiler +set(CMAKE_C_COMPILER @MINGW_PATH@/bin/gcc.bat) +set(CMAKE_CXX_COMPILER @MINGW_PATH@/bin/g++.bat) +set(CMAKE_AR @MINGW_PATH@/bin/ar.bat CACHE FILEPATH "Archiver") +set(CMAKE_LINKER @MINGW_PATH@/bin/ld.bat CACHE FILEPATH "Linker") +SET(CMAKE_RC_COMPILER @MINGW_PATH@/bin/windres.bat) + +# search for programs in the build host directories +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +# for libraries and headers in the target directories +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/project/cmake/addons/depends/windows/cmake/mingw/mingw.txt b/project/cmake/addons/depends/windows/cmake/mingw/mingw.txt new file mode 100644 index 0000000..90aa6ae --- /dev/null +++ b/project/cmake/addons/depends/windows/cmake/mingw/mingw.txt @@ -0,0 +1 @@ +mingw diff --git a/project/cmake/addons/depends/windows/cmake/mingw/mingw32-cmd.bat.in b/project/cmake/addons/depends/windows/cmake/mingw/mingw32-cmd.bat.in new file mode 100644 index 0000000..44a0ea2 --- /dev/null +++ b/project/cmake/addons/depends/windows/cmake/mingw/mingw32-cmd.bat.in @@ -0,0 +1,6 @@ +@ECHO OFF +SETLOCAL + +SET PATH=@MINGW_PATH@/bin;@MSYS_PATH@/usr/bin;%PATH% +@CMD@.exe %* + diff --git a/project/cmake/addons/depends/windows/cmake/mingw/noinstall.txt b/project/cmake/addons/depends/windows/cmake/mingw/noinstall.txt new file mode 100644 index 0000000..e69de29 diff --git a/project/cmake/addons/depends/windows/cmake/msys/CMakeLists.txt b/project/cmake/addons/depends/windows/cmake/msys/CMakeLists.txt new file mode 100644 index 0000000..1c0536e --- /dev/null +++ b/project/cmake/addons/depends/windows/cmake/msys/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.1) +project(msys LANGUAGES NONE) + +# This is an empty dummy dependency because a lot of game addons depend on it. +# After they got fixed, this can be removed. diff --git a/project/cmake/addons/depends/windows/cmake/msys/msys.txt b/project/cmake/addons/depends/windows/cmake/msys/msys.txt new file mode 100644 index 0000000..00de9c2 --- /dev/null +++ b/project/cmake/addons/depends/windows/cmake/msys/msys.txt @@ -0,0 +1 @@ +msys diff --git a/project/cmake/addons/depends/windows/cmake/msys/noinstall.txt b/project/cmake/addons/depends/windows/cmake/msys/noinstall.txt new file mode 100644 index 0000000..e69de29 -- cgit v1.2.3