cross-ming.cmake 972 B

12345678910111213141516171819202122232425262728293031
  1. #
  2. # CMake Toolchain file for crosscompiling on MingW.
  3. #
  4. # This can be used when running cmake in the following way:
  5. # cd build/
  6. # cmake .. -DCMAKE_TOOLCHAIN_FILE=../cross-ming.cmake
  7. #
  8. set(CROSS_PATH /usr/bin)
  9. # Target operating system name.
  10. set(CMAKE_SYSTEM_NAME Windows)
  11. set(BUILD_SHARED_LIBS OFF)
  12. # Name of C compiler.
  13. set(CMAKE_C_COMPILER "${CROSS_PATH}/x86_64-w64-mingw32-gcc")
  14. #set(CMAKE_CXX_COMPILER "${CROSS_PATH}/x86_64-w64-mingw32-g++")
  15. set(CMAKE_RC_COMPILER "${CROSS_PATH}/x86_64-w64-mingw32-windres")
  16. set(CMAKE_C_FLAGS "-Wno-error")
  17. # Where to look for the target environment. (More paths can be added here)
  18. set(CMAKE_FIND_ROOT_PATH "${CROSS_PATH}")
  19. # Adjust the default behavior of the FIND_XXX() commands:
  20. # search programs in the host environment only.
  21. set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
  22. # Search headers and libraries in the target environment only.
  23. set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
  24. set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)