mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
implement auto avaluation of used platform. To use it simply not add -DPLATFORM (#98)
This commit is contained in:
parent
c2e2c26ab2
commit
2013304130
@ -32,6 +32,27 @@ if (APPLE)
|
||||
SET ( DEFAULT_OSX ON )
|
||||
SET ( DEFAULT_V4l2 OFF )
|
||||
else ()
|
||||
if ( NOT DEFINED PLATFORM )
|
||||
if ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "x86" )
|
||||
SET( PLATFORM "x86")
|
||||
elseif ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm" )
|
||||
SET( PLATFORM "rpi")
|
||||
EXEC_PROGRAM( "nproc" OUTPUT_VARIABLE SYSTEM_CPU_CORES )
|
||||
FILE( READ /proc/cpuinfo SYSTEM_CPUINFO )
|
||||
STRING ( TOLOWER "${SYSTEM_CPUINFO}" SYSTEM_CPUINFO )
|
||||
if ( "${SYSTEM_CPUINFO}" MATCHES "amlogic" )
|
||||
SET( PLATFORM "wetek" )
|
||||
elseif( SYSTEM_CPU_CORES GREATER 1 AND "${SYSTEM_CPUINFO}" MATCHES "bcm" )
|
||||
SET( PLATFORM "rpi-pwm" )
|
||||
endif()
|
||||
endif()
|
||||
if ( PLATFORM )
|
||||
message( STATUS "PLATFORM is not defined, evaluated platform: ${PLATFORM}")
|
||||
else()
|
||||
message( FATAL_ERROR "PLATFORM is not defined and could not be evaluated. Set -DPLATFORM=<rpi|pri-pwm|wetek|x86>")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if ( "${PLATFORM}" STREQUAL "rpi" )
|
||||
SET ( DEFAULT_DISPMANX ON )
|
||||
SET ( DEFAULT_SPIDEV ON )
|
||||
|
@ -45,7 +45,6 @@ if (USE_SHARED_AVAHI_LIBS)
|
||||
avahi-client
|
||||
avahi-common
|
||||
avahi-core
|
||||
# avahi-qt4
|
||||
dbus-1)
|
||||
else()
|
||||
target_link_libraries(bonjour
|
||||
@ -53,6 +52,5 @@ else()
|
||||
libavahi-client.a
|
||||
libavahi-common.a
|
||||
libavahi-core.a
|
||||
# libavahi-qt4.a
|
||||
libdbus-1.a)
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user