diff --git a/CMakeLists.txt b/CMakeLists.txt index 247dd002..f4e17b06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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=") + endif() + endif() + if ( "${PLATFORM}" STREQUAL "rpi" ) SET ( DEFAULT_DISPMANX ON ) SET ( DEFAULT_SPIDEV ON ) diff --git a/libsrc/bonjour/CMakeLists.txt b/libsrc/bonjour/CMakeLists.txt index 52a251d7..f3f70b95 100644 --- a/libsrc/bonjour/CMakeLists.txt +++ b/libsrc/bonjour/CMakeLists.txt @@ -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()