Set rpath instead of changing environment for RPi

Credit goes to Adrian Perez de Castro for the improvement.

Signed-off-by: Guillermo A. Amaral <g@maral.me>
This commit is contained in:
Guillermo A. Amaral
2018-02-07 14:12:26 -08:00
parent 965c11f38a
commit bd0def06ee
4 changed files with 4 additions and 17 deletions

View File

@@ -1132,6 +1132,7 @@ macro(CheckRPI)
set(VIDEO_RPI_INCLUDE_DIRS "/opt/vc/include" "/opt/vc/include/interface/vcos/pthreads" "/opt/vc/include/interface/vmcs_host/linux/" )
set(VIDEO_RPI_LIBRARY_DIRS "/opt/vc/lib" )
set(VIDEO_RPI_LIBRARIES bcm_host )
set(VIDEO_RPI_LDFLAGS "-Wl,-rpath,/opt/vc/lib")
endif()
listtostr(VIDEO_RPI_INCLUDE_DIRS VIDEO_RPI_INCLUDE_FLAGS "-I")
listtostr(VIDEO_RPI_LIBRARY_DIRS VIDEO_RPI_LIBRARY_FLAGS "-L")
@@ -1152,6 +1153,7 @@ macro(CheckRPI)
set(SOURCE_FILES ${SOURCE_FILES} ${VIDEO_RPI_SOURCES})
list(APPEND EXTRA_LIBS ${VIDEO_RPI_LIBRARIES})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${VIDEO_RPI_INCLUDE_FLAGS} ${VIDEO_RPI_LIBRARY_FLAGS}")
list(APPEND EXTRA_LDFLAGS ${VIDEO_RPI_LDFLAGS})
endif(SDL_VIDEO AND HAVE_VIDEO_RPI)
endif(VIDEO_RPI)
endmacro(CheckRPI)