Main Lemma Repository
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132
  1. # Sample toolchain file for building for Windows from an Ubuntu Linux system.
  2. #
  3. # Typical usage:
  4. # *) install cross compiler: `sudo apt-get install mingw-w64 g++-mingw-w64`
  5. # *) cd build
  6. # *) cmake -DCMAKE_TOOLCHAIN_FILE=~/Mingw-Cross.cmake ..
  7. set(CMAKE_SYSTEM_NAME Windows)
  8. set(CMAKE_SYSTEM Windows)
  9. set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
  10. SET(CMAKE_CROSSCOMPILING 1)
  11. # cross compilers to use for C and C++
  12. set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
  13. set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
  14. set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
  15. # target environment on the build host system
  16. # set 1st to dir with the cross compiler's C/C++ headers/libs
  17. set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
  18. # modify default behavior of FIND_XXX() commands to
  19. # search for headers/libs in the target environment and
  20. # search for programs in the build host environment
  21. set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
  22. set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
  23. set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
  24. set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
  25. set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
  26. set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")