openauto/cmake_modules/functions.cmake
stefan-sherwood 310b346b3c
Updated Rpi4 revision list, improved readability of code (#10)
Co-authored-by: Stefan Sherwood <miraculum1@gmail.com>
2020-07-20 17:25:24 -05:00

16 lines
549 B
CMake

function( findRpiRevision OUTPUT )
# Find it with an automated script
execute_process( COMMAND grep -Po "^Revision\\s*:\\s*\\K[[:xdigit:]]+" /proc/cpuinfo OUTPUT_VARIABLE TMP OUTPUT_STRIP_TRAILING_WHITESPACE )
# If have not found the Revision number, use the last version
if ( TMP )
message( "-- Detecting Raspberry Pi Revision Number: ${TMP}" )
else()
set( TMP "0006" )
message( WARNING "-- Could NOT find Raspberry Pi revision!" )
endif()
set( ${OUTPUT} "${TMP}" PARENT_SCOPE )
endfunction()