Skip to content

Instantly share code, notes, and snippets.

@tzwenn
Created April 27, 2016 15:46
Show Gist options
  • Save tzwenn/a6b0d3e3118a2075bdf8aaf511c10e4e to your computer and use it in GitHub Desktop.
Save tzwenn/a6b0d3e3118a2075bdf8aaf511c10e4e to your computer and use it in GitHub Desktop.
cmake-toolchain to cross compile opencv to powerpc64le-linux (coming from os x)
set(CMAKE_SYSTEM_NAME Linux)
# Adapt these to match your setup
set(CROSS_COMPILER_PREFIX /opt/gcc-cross)
set(CROSS_COMPILER_TARGET powerpc64le-linux-gnu)
set(CMAKE_SYSTEM_PROCESSOR powerpc64le)
set(CMAKE_C_COMPILER ${CROSS_COMPILER_PREFIX}/bin/${CROSS_COMPILER_TARGET}-gcc)
set(CMAKE_CXX_COMPILER ${CROSS_COMPILER_PREFIX}/bin/${CROSS_COMPILER_TARGET}-g++)
set(CMAKE_AR ${CROSS_COMPILER_PREFIX}/bin/${CROSS_COMPILER_TARGET}-ar CACHE FILEPATH "Archiver")
set(CMAKE_FIND_ROOT_PATH ${CROSS_COMPILER_PREFIX}/${CROSS_COMPILER_TARGET})
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
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