Cmake: add override BUILDARCH for selecting arch
authorThomas Ingleby <thomas.c.ingleby@intel.com>
Tue, 31 Mar 2015 15:34:41 +0000 (16:34 +0100)
committerThomas Ingleby <thomas.c.ingleby@intel.com>
Tue, 31 Mar 2015 15:34:41 +0000 (16:34 +0100)
Stops TargetArch module for running and finding the arch

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
CMakeLists.txt

index dea6a5f..8597080 100644 (file)
@@ -57,10 +57,16 @@ option (BUILDSWIGNODE "Build swig node modules." ON)
 option (IPK "Generate IPK using CPack" OFF)
 option (BUILDPYTHON3 "Use python3 for building/installing" OFF)
 option (INSTALLGPIOTOOL "Install gpio tool" OFF)
+option (BUILDARCH "Override architecture to build for - override" OFF)
 
-include (TargetArch)
-target_architecture (DETECTED_ARCH)
-message( INFO " - Target arch is ${DETECTED_ARCH}")
+if (NOT BUILDARCH)
+  include (TargetArch)
+  target_architecture (DETECTED_ARCH)
+  message( INFO " - Target arch is ${DETECTED_ARCH}")
+else ()
+  set (DETECTED_ARCH ${BUILDARCH})
+  message( INFO " - Override arch is ${DETECTED_ARCH}")
+endif()
 
 if (DETECTED_ARCH STREQUAL "i586" OR DETECTED_ARCH STREQUAL "x86_64"
     OR DETECTED_ARCH STREQUAL "i386")