summarylogtreecommitdiffstats
path: root/CMakeLists.patch
blob: d7decc5ecdb5edf0b67ffce90876fad32b27bf78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ac9f5b3..247aaae 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -155,6 +155,26 @@ IF (NOT WIN32)
      ENDIF (EXISTS /etc/os-release OR EXISTS /etc/sysconfig/SuSEfirewall2.d OR EXISTS /etc/suse-release OR EXISTS /etc/SuSE-release)
     ENDIF(NOT DEFINED PACKAGE_FORMAT)
 
+    IF (EXISTS /etc/arch-release)
+      IF (CMAKE_SYSTEM_PROCESSOR MATCHES "arm*")
+        IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+          SET (ARCH "arm64")
+          ADD_DEFINITIONS( -DOCPN_ARM64 )
+        ELSE (CMAKE_SIZEOF_VOID_P MATCHES "8")
+          SET (ARCH "armhf")
+          ADD_DEFINITIONS( -DOCPN_ARMHF )
+        ENDIF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+      ELSE (CMAKE_SYSTEM_PROCESSOR MATCHES "arm*")
+        IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+            SET (ARCH "x86_64")
+            SET (LIB_INSTALL_DIR "lib")
+        ELSE (CMAKE_SIZEOF_VOID_P MATCHES "8")
+            SET (ARCH "i386")
+            SET (LIB_INSTALL_DIR "lib")
+        ENDIF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+      ENDIF (CMAKE_SYSTEM_PROCESSOR MATCHES "arm*")
+    ENDIF (EXISTS /etc/arch-release)
+
   ENDIF (UNIX AND NOT APPLE)
   
   IF(APPLE)