[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Debian 8: CMake toolchain file for multiarch environment



I'm trying to construct a suitable toolchain for CMake. I took
Buildroot's toochain.cmake and trying to tweak it:

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR armv7l)

# specify the cross compiler
SET(CMAKE_C_COMPILER   "/usr/bin/arm-linux-gnueabihf-gcc")
SET(CMAKE_CXX_COMPILER "/usr/bin/arm-linux-gnueabihf-g++")

set(CMAKE_C_FLAGS "-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64 -Os ${CMAKE_C_FLAGS}" CACHE STRING "Buildroot
CFLAGS")
set(CMAKE_CXX_FLAGS "-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64 -Os ${CMAKE_CXX_FLAGS}" CACHE STRING "Buildroot
CXXFLAGS")
set(CMAKE_EXE_LINKER_FLAGS " ${CMAKE_EXE_LINKER_FLAGS}" CACHE STRING
"Buildroot LDFLAGS")
set(CMAKE_INSTALL_SO_NO_EXE 0)

set(CMAKE_PROGRAM_PATH "/usr/bin")
set(CMAKE_FIND_ROOT_PATH "/usr/lib/arm-linux-gnueabihf/cmake")
set(CMAKE_PREFIX_PATH "/usr/lib/arm-linux-gnueabihf/cmake")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(ENV{PKG_CONFIG_SYSROOT_DIR} "/usr/lib/arm-linux-gnueabihf/")

I have following problem with Qt5, i.e.Qt5WidgetsConfig.cmake will be
found with proper CMAKE_FIND_ROOT_PATH, but then something is missing
for CMake to work properly :

CMake Error at /usr/lib/arm-linux-gnueabihf/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:100
(find_package):
  Could not find a package configuration file provided by "Qt5Gui" (requested
  version 5.3.2) with any of the following names:

    Qt5GuiConfig.cmake
    qt5gui-config.cmake

  Add the installation prefix of "Qt5Gui" to CMAKE_PREFIX_PATH or set
  "Qt5Gui_DIR" to a directory containing one of the above files.  If "Qt5Gui"
  provides a separate development package or SDK, be sure it has been
  installed.
Call Stack (most recent call first):
  CMakeLists.txt:23 (FIND_PACKAGE)

It would be great, if https://wiki.debian.org/CrossToolchains would
provide a sample toolcahin.cmake.

Regards,
Yegor


Reply to: