2009-11-09 19:14:21 +03:00
|
|
|
cmake_minimum_required (VERSION 2.6)
|
2012-08-13 21:47:32 +04:00
|
|
|
project(CrossCompile)
|
2009-11-09 19:14:21 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
unset(run_result CACHE)
|
2009-11-09 20:05:49 +03:00
|
|
|
|
2009-11-09 19:14:21 +03:00
|
|
|
#Simulate the cross compile condition
|
2012-08-13 21:47:32 +04:00
|
|
|
set(CMAKE_CROSSCOMPILING ON)
|
2009-11-09 19:14:21 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
add_executable(CrossCompile main.c)
|
2009-11-09 19:14:21 +03:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
try_run(run_result compile_result
|
2012-08-13 21:42:58 +04:00
|
|
|
${CrossCompile_BINARY_DIR}
|
2009-11-09 19:14:21 +03:00
|
|
|
${CrossCompile_SOURCE_DIR}/main.c)
|