Created
October 20, 2014 06:23
-
-
Save moodoki/405f762bf9bbfdada918 to your computer and use it in GitHub Desktop.
CMake toolchain file for building OpenSceneGraph with a cross compiler toolchain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET(CMAKE_SYSTEM_NAME Linux) | |
SET(CMAKE_SYSROOT /path/to/rootfs) | |
#debian dependencies required for building: | |
# libpthread-stubs0-dev_0.3-2_armel.deb | |
# libx11-6_1.3.3-4+squeeze1_armel.deb | |
# libx11-dev_1.3.3-4+squeeze1_armel.deb | |
# libxau-dev_1.0.6-1_armel.deb | |
# libxcb1_1.6-1+squeeze1_armel.deb | |
# libxcb1-dev_1.6-1+squeeze1_armel.deb | |
# libxdmcp-dev_1.0.3-2_armel.deb | |
# libxrandr2_1.3.0-3+squeeze1_armel.deb | |
# libxrandr2_1.3.0-3+squeeze1_armel.deb.1 | |
# libxrandr-dev_1.3.0-3+squeeze1_armel.deb | |
# libxrender-dev_0.9.6-1+squeeze1_armel.deb | |
# x11-common_7.5+8+squeeze1_all.deb | |
# x11proto-core-dev_7.0.16-1_all.deb | |
# x11proto-input-dev_2.0-2_all.deb | |
# x11proto-kb-dev_1.0.4-1_all.deb | |
# x11proto-randr-dev_1.3.1-1_all.deb | |
# x11proto-render-dev_0.11-1_all.deb | |
# xtrans-dev_1.2.5-1_all.deb | |
SET(CMAKE_C_COMPILER /path/to/cross-compiler-root/bin/arm-cortexa9_neon-linux-gnueabihf-gcc) | |
SET(CMAKE_CXX_COMPILER /path/to/cross-compiler-root/bin/arm-cortexa9_neon-linux-gnueabihf-g++) | |
SET(CMAKE_FIND_ROOT_PATH /path/to/cross-compiler-root /path/to/rootfs) | |
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | |
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | |
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | |
SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) | |
#ARM Vivante GPU headers require LINUX and EGL_API_FB to be defined to correctly detect the target platform | |
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -DLINUX=1 -DEGL_API_FB=1" CACHE STRING "") | |
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -U_FORTIFY_SOURCE -DLINUX=1 -DEGL_API_FB=1" CACHE STRING "") | |
#CMAKE command used to configure (Change OPENGL_PROFILE=GLES1 for OpenGL ES1 build) | |
# | |
# cmake -DCMAKE_TOOLCHAIN_FILE=../../toolchain-arm-cortexa9_neon-linux-gnueabihf.cmake -DOPENGL_PROFILE=GLES2 -DDYNAMIC_OPENTHREADS=OFF -DDYNAMIC_OPENSCENEGRAPH=OFF -DOPENGL_INCLUDE_DIR=../../debian_rootfs/usr/include -D_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS_EXITCODE:BOOL=OFF -DBUILD_OSG_APPLICATIONS:BOOL=OFF ../osg-master/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment