My CMake modules, scripts, templates
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

26 lines
1.1 KiB

# Kernel of Operation System
EXECUTE_PROCESS (COMMAND uname -s COMMAND tr -d '\n' OUTPUT_VARIABLE OSKERNEL)
MESSAGE ("OSKERNEL = ${OSKERNEL}")
STRING (TOLOWER "${OSKERNEL}" OSKERNEL)
# CPU Architecture
SET (CUSTOM_ARCHITECTURE "" CACHE STRING "Specify custom target architecutre")
SET (ARCHITECTURE "${CUSTOM_ARCHITECTURE}")
IF (ARCHITECTURE STREQUAL "")
# SET (ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}")
# SET (ARCHITECTURE "${CMAKE_HOST_SYSTEM_PROCESSOR}")
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 ()
MESSAGE ("ARCHITECTURE = ${ARCHITECTURE}")