From b792162113e08e32b9f3bc4d536dabcf5d9487cd Mon Sep 17 00:00:00 2001 From: "Nicholas J. Kain" Date: Thu, 12 Feb 2015 13:35:50 -0500 Subject: [PATCH] Add CROSSCOMPILE_MACHINENAME environment variable for CMake that will allow the host machine type detection to be skipped and the target MACHINENAME to be manually defined. --- CMakeLists.txt | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2399099..acaa451 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,12 +120,17 @@ else() message("Could not detect glibc version.") endif() -execute_process( - COMMAND uname -m - COMMAND tr "\n" " " - COMMAND sed "s/ //" - OUTPUT_VARIABLE MACHINENAME - ) +if ("$ENV{CROSSCOMPILE_MACHINENAME}" STREQUAL "") + execute_process( + COMMAND uname -m + COMMAND tr "\n" " " + COMMAND sed "s/ //" + OUTPUT_VARIABLE MACHINENAME + ) +else() + message("skipped machine detection; MACHINENAME is '$ENV{CROSSCOMPILE_MACHINENAME}'") + set(MACHINENAME $ENV{CROSSCOMPILE_MACHINENAME}) +endif() if (${MACHINENAME} STREQUAL "x86_64") message("Detected that the current host is x86_64. Enabling seccomp-filter.")