From 55a435974978a7ca59e34fb77e7b188016bb639d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 28 Jan 2018 23:41:35 +0100 Subject: [PATCH] Add mingw toolchain file for cmake --- CMakeLists_mingw.txt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 CMakeLists_mingw.txt diff --git a/CMakeLists_mingw.txt b/CMakeLists_mingw.txt new file mode 100644 index 00000000..ffb338d4 --- /dev/null +++ b/CMakeLists_mingw.txt @@ -0,0 +1,25 @@ +SET(CMAKE_SYSTEM_NAME Windows) + +SET(COMPILER_PREFIX i686-w64-mingw32-) +SET(CMAKE_C_COMPILER ${COMPILER_PREFIX}gcc) +SET(CMAKE_CXX_COMPILER ${COMPILER_PREFIX}c++) +SET(CMAKE_RC_COMPILER ${COMPILER_PREFIX}windres) +SET(CMAKE_PKGCONFIG_EXECUTABLE ${COMPILER_PREFIX}pkg-config) +SET(PKG_CONFIG_EXECUTABLE ${COMPILER_PREFIX}pkg-config) +SET(CMAKE_SYSTEM_PROCESSOR x86) + +if(APPLE) + SET(TARGET_ENVIRONMENT /usr/local/mingw-w32-bin_i686-darwin/i686-w64-mingw32) +else() + SET(TARGET_ENVIRONMENT /usr/i686-w64-mingw32) +endif(APPLE) + +# here is the target environment located +SET(CMAKE_FIND_ROOT_PATH ${TARGET_ENVIRONMENT}) + +# adjust the default behaviour of the FIND_XXX() commands: +# search headers and libraries in the target environment, search +# programs in the host environment +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)