summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/toolchain-mingw32.cmake16
1 files changed, 16 insertions, 0 deletions
diff --git a/cmake/toolchain-mingw32.cmake b/cmake/toolchain-mingw32.cmake
new file mode 100644
index 000000000..b884771ce
--- /dev/null
+++ b/cmake/toolchain-mingw32.cmake
@@ -0,0 +1,16 @@
+SET(CMAKE_SYSTEM_NAME Windows)
+
+FIND_PROGRAM(CMAKE_C_COMPILER NAMES i686-mingw32-gcc i586-mingw32-gcc mingw32-gcc)
+FIND_PROGRAM(CMAKE_CXX_COMPILER NAMES i686-mingw32-g++ i586-mingw32-gcc mingw32-g++)
+
+EXECUTE_PROCESS(
+ COMMAND ${CMAKE_C_COMPILER} -print-sysroot
+ OUTPUT_VARIABLE CMAKE_FIND_ROOT_PATH
+)
+
+# Does not work - don't know why
+SET(ENV{PKG_CONFIG_SYSROOT_DIR} ${CMAKE_FIND_ROOT_PATH})
+
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)