🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
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.

39 lines
1.7 KiB

  1. # Cross-compiling requires CMake 2.6 or newer. Example:
  2. # cmake .. -DCMAKE_TOOLCHAIN_FILE=../XCompile-Android.txt -DHOST=arm-linux-androideabi
  3. # Where 'arm-linux-androideabi' is the host prefix for the cross-compiler. If
  4. # you already have a toolchain file setup, you may use that instead of this
  5. # file. Make sure to set CMAKE_FIND_ROOT_PATH to where the NDK toolchain was
  6. # installed (e.g. "$ENV{HOME}/toolchains/arm-linux-androideabi-r10c-21").
  7. # the name of the target operating system
  8. SET(CMAKE_SYSTEM_NAME Linux)
  9. # which compilers to use for C and C++
  10. SET(CMAKE_C_COMPILER "${HOST}-gcc")
  11. SET(CMAKE_CXX_COMPILER "${HOST}-g++")
  12. SET(CMAKE_RC_COMPILER "${HOST}-windres")
  13. # here is the target environment located
  14. SET(CMAKE_FIND_ROOT_PATH "SET THIS TO THE NDK TOOLCHAIN'S INSTALL PATH")
  15. # here is where stuff gets installed to
  16. SET(CMAKE_INSTALL_PREFIX "${CMAKE_FIND_ROOT_PATH}" CACHE STRING "Install path prefix, prepended onto install directories." FORCE)
  17. # adjust the default behaviour of the FIND_XXX() commands:
  18. # search headers and libraries in the target environment, search
  19. # programs in the host environment
  20. set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
  21. set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
  22. set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
  23. # set env vars so that pkg-config will look in the appropriate directory for
  24. # .pc files (as there seems to be no way to force using ${HOST}-pkg-config)
  25. set(ENV{PKG_CONFIG_LIBDIR} "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
  26. set(ENV{PKG_CONFIG_PATH} "")
  27. # Qt4 tools
  28. SET(QT_QMAKE_EXECUTABLE ${HOST}-qmake)
  29. SET(QT_MOC_EXECUTABLE ${HOST}-moc)
  30. SET(QT_RCC_EXECUTABLE ${HOST}-rcc)
  31. SET(QT_UIC_EXECUTABLE ${HOST}-uic)
  32. SET(QT_LRELEASE_EXECUTABLE ${HOST}-lrelease)