https://github.com/Kitware/CMake
Raw File
Tip revision: 3e5548784da085ee3a5ce3f7213c0cf281b68f31 authored by Brad King on 03 October 2018, 12:20:44 UTC
CMake 3.12.3
Tip revision: 3e55487
CMakeLists.txt
cmake_minimum_required (VERSION 2.6)
project(CrossCompile)

unset(run_result CACHE)

#Simulate the cross compile condition
set(CMAKE_CROSSCOMPILING ON)

add_executable(CrossCompile main.c)

try_run(run_result compile_result
    ${CrossCompile_BINARY_DIR}
    ${CrossCompile_SOURCE_DIR}/main.c)
back to top