openauto/cmake_modules/functions.cmake
2020-07-11 22:00:57 -05:00

16 lines
516 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 )
# 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()