2010-03-17 14:00:29 +02:00
|
|
|
cmake_minimum_required (VERSION 2.6)
|
2013-03-16 19:13:01 +02:00
|
|
|
project(CrossCompile)
|
2010-03-17 14:00:29 +02:00
|
|
|
|
2013-03-16 19:13:01 +02:00
|
|
|
unset(run_result CACHE)
|
2010-03-17 14:00:29 +02:00
|
|
|
|
|
|
|
#Simulate the cross compile condition
|
2013-03-16 19:13:01 +02:00
|
|
|
set(CMAKE_CROSSCOMPILING ON)
|
2010-03-17 14:00:29 +02:00
|
|
|
|
2013-03-16 19:13:01 +02:00
|
|
|
add_executable(CrossCompile main.c)
|
2010-03-17 14:00:29 +02:00
|
|
|
|
2013-03-16 19:13:01 +02:00
|
|
|
try_run(run_result compile_result
|
|
|
|
${CrossCompile_BINARY_DIR}
|
2010-03-17 14:00:29 +02:00
|
|
|
${CrossCompile_SOURCE_DIR}/main.c)
|