1
# Cross compiling from linux using g++-multilib to create 32 bit output
2
# On ubuntu, you'll need to install the packages: g++-multilib gcc-multilib
5
# cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-g++32.cmake ..
7
SET(CMAKE_CXX_FLAGS "-m32")
8
SET(CMAKE_C_FLAGS "-m32")
9
SET(CMAKE_EXE_LINKER_FLAGS "-m32")
10
SET(CMAKE_MODULE_LINKER_FLAGS "-m32")
12
# here is the target environment located
13
SET(CMAKE_FIND_ROOT_PATH /usr/lib32 )
15
# adjust the default behaviour of the FIND_XXX() commands:
16
# search headers and libraries in the target environment, search
17
# programs in the host environment
18
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
19
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)