summaryrefslogtreecommitdiffstats
path: root/project/cmake/addons
diff options
context:
space:
mode:
Diffstat (limited to 'project/cmake/addons')
-rw-r--r--project/cmake/addons/depends/windows/cmake/mingw/CMakeLists.txt33
-rw-r--r--project/cmake/addons/depends/windows/cmake/mingw/MinGWConfig.cmake.in3
-rw-r--r--project/cmake/addons/depends/windows/cmake/mingw/Toolchain_mingw32.cmake.in17
-rw-r--r--project/cmake/addons/depends/windows/cmake/mingw/mingw.txt1
-rw-r--r--project/cmake/addons/depends/windows/cmake/mingw/mingw32-cmd.bat.in6
-rw-r--r--project/cmake/addons/depends/windows/cmake/mingw/noinstall.txt0
-rw-r--r--project/cmake/addons/depends/windows/cmake/msys/CMakeLists.txt5
-rw-r--r--project/cmake/addons/depends/windows/cmake/msys/msys.txt1
-rw-r--r--project/cmake/addons/depends/windows/cmake/msys/noinstall.txt0
9 files changed, 66 insertions, 0 deletions
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 @@
1cmake_minimum_required(VERSION 3.1)
2project(mingw)
3
4function(generate_mingw32_wrapper cmd)
5 set(CMD ${cmd})
6 configure_file(${PROJECT_SOURCE_DIR}/mingw32-cmd.bat.in ${MINGW_PATH}/bin/${CMD}.bat @ONLY)
7endfunction()
8
9get_filename_component(CORE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../../../../../../.. REALPATH)
10
11set(MSYS_PATH "${CORE_SOURCE_DIR}/project/BuildDependencies/msys64")
12set(MINGW_PATH "${MSYS_PATH}/mingw32")
13
14# configure the MinGW toolchain file
15configure_file(${PROJECT_SOURCE_DIR}/Toolchain_mingw32.cmake.in ${CMAKE_INSTALL_PREFIX}/Toolchain_mingw32.cmake @ONLY)
16
17# configure MinGWConfig.cmake
18configure_file(${PROJECT_SOURCE_DIR}/MinGWConfig.cmake.in ${CMAKE_INSTALL_PREFIX}/MinGWConfig.cmake)
19
20# TODO: MinGW GCC 5.3.0-1 comes without cc.exe, Remove this once package is bumped to 5.3.0-p2
21# See https://github.com/Alexpux/MINGW-packages/pull/1034
22if(NOT EXISTS ${MINGW_PATH}/bin/cc.exe)
23 execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${MINGW_PATH}/bin/gcc.exe ${MINGW_PATH}/bin/cc.exe)
24endif()
25
26# configure the MinGW wrapper batch scripts
27generate_mingw32_wrapper("make")
28generate_mingw32_wrapper("gcc")
29generate_mingw32_wrapper("cc")
30generate_mingw32_wrapper("g++")
31generate_mingw32_wrapper("ar")
32generate_mingw32_wrapper("ld")
33generate_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 @@
1set(MINGW_INCLUDE_DIRS @MINGW_PATH@/include)
2set(MINGW_MAKE @MINGW_PATH@/bin/make.bat -j$ENV{NUMBER_OF_PROCESSORS})
3set(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 @@
1set(CMAKE_SYSTEM_VERSION 1)
2set(CMAKE_SYSTEM_NAME Windows)
3
4set(CMAKE_FIND_ROOT_PATH @CMAKE_FIND_ROOT_PATH@ @CMAKE_INSTALL_PREFIX@ @MSYS_PATH@ @MINGW_PATH@)
5
6# specify the cross compiler
7set(CMAKE_C_COMPILER @MINGW_PATH@/bin/gcc.bat)
8set(CMAKE_CXX_COMPILER @MINGW_PATH@/bin/g++.bat)
9set(CMAKE_AR @MINGW_PATH@/bin/ar.bat CACHE FILEPATH "Archiver")
10set(CMAKE_LINKER @MINGW_PATH@/bin/ld.bat CACHE FILEPATH "Linker")
11SET(CMAKE_RC_COMPILER @MINGW_PATH@/bin/windres.bat)
12
13# search for programs in the build host directories
14set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
15# for libraries and headers in the target directories
16set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
17set(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 @@
1@ECHO OFF
2SETLOCAL
3
4SET PATH=@MINGW_PATH@/bin;@MSYS_PATH@/usr/bin;%PATH%
5@CMD@.exe %*
6
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
--- /dev/null
+++ b/project/cmake/addons/depends/windows/cmake/mingw/noinstall.txt
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 @@
1cmake_minimum_required(VERSION 3.1)
2project(msys LANGUAGES NONE)
3
4# This is an empty dummy dependency because a lot of game addons depend on it.
5# 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
--- /dev/null
+++ b/project/cmake/addons/depends/windows/cmake/msys/noinstall.txt