Browse Source

Fix architecture detection when MinGW is 32 while host is 64.

master
Kolan Sh 5 years ago
parent
commit
5a8221f571
  1. 8
      CPackDetectArch.cmake

8
CPackDetectArch.cmake

@ -9,11 +9,17 @@ SET (ARCHITECTURE "${CUSTOM_ARCHITECTURE}")
IF (ARCHITECTURE STREQUAL "")
# SET (ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}")
# SET (ARCHITECTURE "${CMAKE_HOST_SYSTEM_PROCESSOR}")
EXECUTE_PROCESS(COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE ARCHITECTURE)
IF (WIN32)
EXECUTE_PROCESS(COMMAND uname -s COMMAND tr -d '\n' OUTPUT_VARIABLE ARCHITECTURE)
ELSE (WIN32)
EXECUTE_PROCESS(COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE ARCHITECTURE)
ENDIF (WIN32)
# Replacements
STRING (REGEX REPLACE "^x86_64$" "amd64" ARCHITECTURE "${ARCHITECTURE}")
STRING (REGEX REPLACE "MINGW64.*" "amd64" ARCHITECTURE "${ARCHITECTURE}")
STRING (REGEX REPLACE "^i.86$" "i386" ARCHITECTURE "${ARCHITECTURE}")
STRING (REGEX REPLACE "MINGW32.*" "i386" ARCHITECTURE "${ARCHITECTURE}")
STRING (REGEX REPLACE "^armv7l$" "armel" ARCHITECTURE "${ARCHITECTURE}")
ENDIF ()

Loading…
Cancel
Save