diff --git a/CMakeLists.txt b/CMakeLists.txt index 9320287..93f0e07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,10 +60,11 @@ if(GST_BUILD) add_definitions(-DRPI) include(${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/functions.cmake) findRpiRevision( RPI_REVISION ) - if(RPI_REVISION MATCHES "a03111" OR RPI_REVISION MATCHES "b03111" OR RPI_REVISION MATCHES "a03111") + set(RPI_4_REVISIONS a03111 b03111 b03112 c03111 c03112 d03114) + if(RPI_REVISION IN_LIST RPI_4_REVISIONS) message("Raspberry Pi 4 Found") add_definitions(-DPI4) - endif(RPI_REVISION MATCHES "a03111" OR RPI_REVISION MATCHES "b03111" OR RPI_REVISION MATCHES "a03111") + endif(RPI_REVISION IN_LIST RPI_4_REVISIONS) endif(RPI_BUILD) message(STATUS "${GST_LIBRARIES}") endif(GST_BUILD) diff --git a/cmake_modules/functions.cmake b/cmake_modules/functions.cmake index 18f5864..99be6e3 100644 --- a/cmake_modules/functions.cmake +++ b/cmake_modules/functions.cmake @@ -1,7 +1,7 @@ function( findRpiRevision OUTPUT ) # Find it with an automated script - execute_process( COMMAND grep -Po "^Revision\\s*:\\s*\\K[[:xdigit:]]+" /proc/cpuinfo OUTPUT_VARIABLE TMP ) + 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 )