Cross-kompilacja QtGstreamer’a 1.2.0 – cmake

Masz problemy z cross-kompilacją QtGstreamer’a ? Poniżej działający arm.cmake dla Raspberry Pi, oczywiście, jeśli masz wcześniej utworzonego sysroota ze skompilowanym Qt i innymi wymaganymi bibliotekami.

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_FIND_ROOT_PATH /home/mariusz/raspi/sysroot)
include_directories(${CMAKE_FIND_ROOT_PATH}/usr/include/arm-linux-gnueabihf)
include_directories(${CMAKE_FIND_ROOT_PATH}/usr/lib/arm-linux-gnueabihf/glib-2.0/include)
set(CMAKE_C_COMPILER /opt/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER /opt/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++)
set(CMAKE_PREFIX_PATH /home/mariusz/raspi/qt5pi/lib/cmake)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
#SET(CMAKE_LIBRARY_PATH ${CMAKE_FIND_ROOT_PATH}/usr/lib/arm-linux-gnueabihf)
SET(PKG_CONFIG_SYSROOT_DIR ${CMAKE_FIND_ROOT_PATH})
SET(PKG_CONFIG_PATH ${CMAKE_FIND_ROOT_PATH}/usr/lib/pkgconfig ${CMAKE_FIND_ROOT_PATH}/usr/lib/arm-linux-gnueabihf/pkgconfig)
SET(CMAKE_SHARED_LINKER_FLAGS "--sysroot=/home/mariusz/raspi/sysreoot")

SET(QTGSTREAMER_CODEGEN OFF)

Dodatkowo w pliku CMakeLists.txt należy dodać kilka linijek, najlepiej pod set(QTGSTREAMER_VERSION 1.2.0):

option(QTGSTREAMER_STATIC "Build QtGStreamer as a static library" OFF)
option(QTGSTREAMER_TESTS "Build QtGStreamer's tests" OFF)
option(QTGSTREAMER_EXAMPLES "Build QtGStreamer's examples" OFF)
option(QTGSTREAMER_CODEGEN "Build and use QtGStreamer's codegen" OFF)
option(USE_GST_PLUGIN_DIR "Install gstreamer plugins at the system location" OFF)
option(USE_QT_PLUGIN_DIR "Install qt plugins at the system location" OFF)

Paczka gotowa do cross-kompilacji: qt-gstreamer-1.2.0_armcmake.tar