Permalink
Browse files

added: cmake command line options for raspberry pi distributions that…

… don't use standard system paths for libs for some reason
  • Loading branch information...
opdenkamp committed Jul 3, 2015
1 parent a7cc070 commit 3b749cba1bc3cc3e45ec1dfe6b328818ad283b10
Showing with 16 additions and 7 deletions.
  1. +5 −0 README.md
  2. +10 −4 src/libcec/cmake/CheckPlatformSupport.cmake
  3. +1 −3 src/libcec/cmake/LinkPlatformSupport.cmake
View
@@ -34,6 +34,11 @@ make
sudo make install
```
If you're compiling for a Raspberry Pi, then the path to the required headers and libraries can be set manually, in case it's not in a standard system directory:
```
cmake -DRPI_INCLUDE_DIR=/opt/vc/include -DRPI_LIB_DIR=/opt/vc/lib ..
```
## Apple OS X
To compile libCEC on OS X, you'll need the following dependencies:
@@ -10,11 +10,15 @@
# HAVE_RPI_API 1 if Raspberry Pi is supported
# HAVE_TDA995X_API 1 if TDA995X is supported
# HAVE_EXYNOS_API 1 if Exynos is supported
# HAVE_P8_USB_DETECT 1 if Pulse-Eight devices can be auto-detected
# HAVE_P8_USB_DETECT 1 if Pulse-Eight devices can be auto-detected
#
set(PLATFORM_LIBREQUIRES "")
# Raspberry Pi libs and headers are in a non-standard path on some distributions
set(RPI_INCLUDE_DIR "" CACHE FILEPATH "root path to Raspberry Pi includes")
set(RPI_LIB_DIR "" CACHE FILEPATH "root path to Raspberry Pi libs")
# Pulse-Eight devices are always supported
add_definitions(-DHAVE_P8_USB)
@@ -75,11 +79,13 @@ else()
endif()
# raspberry pi
check_library_exists(bcm_host vchi_initialise "" HAVE_RPI_API)
find_library(RPI_BCM_HOST bcm_host ${RPI_LIB_DIR})
check_library_exists(bcm_host bcm_host_init ${RPI_LIB_DIR} HAVE_RPI_API)
if (HAVE_RPI_API)
set(LIB_INFO "${LIB_INFO}, 'RPi'")
list(APPEND CMAKE_REQUIRED_LIBRARIES "vcos")
list(APPEND CMAKE_REQUIRED_LIBRARIES "vchiq_arm")
find_library(RPI_VCOS vcos ${RPI_LIB_DIR} REQUIRED)
find_library(RPI_VCHIQ_ARM vchiq_arm ${RPI_LIB_DIR} REQUIRED)
include_directories(${RPI_INCLUDE_DIR})
set(CEC_SOURCES_ADAPTER_RPI adapter/RPi/RPiCECAdapterDetection.cpp
adapter/RPi/RPiCECAdapterCommunication.cpp
adapter/RPi/RPiCECAdapterMessageQueue.cpp)
@@ -28,9 +28,7 @@ endif()
# raspberry pi
if (HAVE_RPI_API)
target_link_libraries(cec vcos)
target_link_libraries(cec vchiq_arm)
target_link_libraries(cec bcm_host)
target_link_libraries(cec ${RPI_VCOS} ${RPI_VCHIQ_ARM} ${RPI_BCM_HOST})
endif()
# Apple

0 comments on commit 3b749cb

Please sign in to comment.