Skip to content

Instantly share code, notes, and snippets.

@take-cheeze
Created May 30, 2012 12:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save take-cheeze/2835996 to your computer and use it in GitHub Desktop.
Save take-cheeze/2835996 to your computer and use it in GitHub Desktop.
# the name of the target operating system
set(CMAKE_SYSTEM_NAME Windows)
# which compilers to use for C and C++
include(CMakeForceCompiler)
cmake_force_c_compiler(i586-mingw32msvc-gcc GNU)
cmake_force_cxx_compiler(i586-mingw32msvc-g++ GNU)
set(CMAKE_RC_COMPILER i586-mingw32msvc-windres)
# here is the target environment located
set(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc $ENV{PWD}/mingw-install)
# 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment