diff --git a/cmake/cross-toolchain-mingw32.cmake b/cmake/cross-toolchain-mingw32.cmake new file mode 100644 index 00000000..3c97d7a0 --- /dev/null +++ b/cmake/cross-toolchain-mingw32.cmake @@ -0,0 +1,16 @@ +# Target operating system and architecture +set( CMAKE_SYSTEM_NAME Windows ) +set( CMAKE_SYSTEM_PROCESSOR x86 ) + +# C/C++ compilers +set( CMAKE_C_COMPILER i686-w64-mingw32-gcc ) +set( CMAKE_CXX_COMPILER i686-w64-mingw32-g++ ) +set( CMAKE_RC_COMPILER i686-w64-mingw32-windres ) + +# Target prefix +set( CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32 ) + +# Find programs using host paths and headers/libraries using target paths +set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER ) +set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) +set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) diff --git a/cmake/cross-toolchain-mingw64.cmake b/cmake/cross-toolchain-mingw64.cmake new file mode 100644 index 00000000..fb308a45 --- /dev/null +++ b/cmake/cross-toolchain-mingw64.cmake @@ -0,0 +1,16 @@ +# Target operating system and architecture +set( CMAKE_SYSTEM_NAME Windows ) +set( CMAKE_SYSTEM_PROCESSOR x86_64 ) + +# C/C++ compilers +set( CMAKE_C_COMPILER x86_64-w64-mingw32-gcc ) +set( CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++ ) +set( CMAKE_RC_COMPILER x86_64-w64-mingw32-windres ) + +# Target prefix +set( CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 ) + +# Find programs using host paths and headers/libraries using target paths +set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER ) +set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) +set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )