cross-mingw32-linux.cmake 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. # the name of the target operating system
  2. set(CMAKE_SYSTEM_NAME Windows)
  3. # Choose an appropriate compiler prefix
  4. # for classical mingw32
  5. # see http://www.mingw.org/
  6. #set(COMPILER_PREFIX "i586-mingw32msvc")
  7. # for 32 or 64 bits mingw-w64
  8. # see http://mingw-w64.sourceforge.net/
  9. set(COMPILER_PREFIX "i586-mingw32msvc")
  10. #set(COMPILER_PREFIX "x86_64-w64-mingw32"
  11. # which compilers to use for C and C++
  12. find_program(CMAKE_RC_COMPILER NAMES ${COMPILER_PREFIX}-windres)
  13. #SET(CMAKE_RC_COMPILER ${COMPILER_PREFIX}-windres)
  14. find_program(CMAKE_C_COMPILER NAMES ${COMPILER_PREFIX}-gcc)
  15. #SET(CMAKE_C_COMPILER ${COMPILER_PREFIX}-gcc)
  16. find_program(CMAKE_CXX_COMPILER NAMES ${COMPILER_PREFIX}-g++)
  17. #SET(CMAKE_CXX_COMPILER ${COMPILER_PREFIX}-g++)
  18. # here is the target environment located
  19. set(CMAKE_FIND_ROOT_PATH /usr/${COMPILER_PREFIX})
  20. # adjust the default behaviour of the FIND_XXX() commands:
  21. # search headers and libraries in the target environment, search
  22. # programs in the host environment
  23. set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
  24. set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
  25. set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)