set(CMAKE_CROSSCOMPILING TRUE)

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR i686)

set(CMAKE_C_COMPILER gcc)
set(CMAKE_CXX_COMPILER g++)
set(CMAKE_C_FLAGS_INIT -m32)
set(CMAKE_CXX_FLAGS_INIT -m32)
set(CMAKE_EXE_LINKER_FLAGS_INIT -m32)
set(CMAKE_SHARED_LINKER_FLAGS_INIT -m32)
set(CMAKE_MODULE_LINKER_FLAGS_INIT -m32)

string(TOLOWER ${CMAKE_SYSTEM_NAME} SYSTEM_LOWER)
set(PKG_CONFIG_EXECUTABLE ${CMAKE_SYSTEM_PROCESSOR}-${SYSTEM_LOWER}-gnu-pkg-config)
