You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks a lot for your work, it helped me a lot to finally get into cross compile world.
I need to add a library (GLog) into my project but I'm struggling to make it work.
In the CMakeLists.txt of Glog, I added :
# Cross-compilation system informationset(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR arm)
# The sysroot contains all the libraries we might need to link against and # possibly headers we need for compilationset(CMAKE_SYSROOT /var/lib/schroot/chroots/schroot-name-armhf)
set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT})
set(CMAKE_LIBRARY_ARCHITECTURE arm-linux-gnueabihf)
set(CMAKE_STAGING_PREFIX $ENV{HOME}/RPi-dev/staging-armv6-rpi)
# Set the compilers for C, C++ and Fortranset(RPI_GCC_TRIPLE "armv6-rpi-linux-gnueabihf")
set(CMAKE_C_COMPILER ${RPI_GCC_TRIPLE}-gcc CACHE FILEPATH "C compiler")
set(CMAKE_CXX_COMPILER ${RPI_GCC_TRIPLE}-g++ CACHE FILEPATH "C++ compiler")
set(CMAKE_Fortran_COMPILER ${RPI_GCC_TRIPLE}-gfortran CACHE FILEPATH "Fortran compiler")
# Set the architecture-specific compiler flagsset(ARCH_FLAGS "-mcpu=arm1176jzf-s")
set(CMAKE_C_FLAGS_INIT ${ARCH_FLAGS})
set(CMAKE_CXX_FLAGS_INIT ${ARCH_FLAGS})
set(CMAKE_Fortran_FLAGS_INIT ${ARCH_FLAGS})
# Don't look for programs in the sysroot (these are ARM programs, they won't run# on the build machine)set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# Only look for libraries, headers and packages in the sysroot, don't look on # the build machineset(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE armhf)
It got Build without any error, but when I add just a little 'find_package (glog REQUIRED)' in the CMakeLists.txt of my Project, I get:
CMake Error at CMakeLists.txt:11 (find_package):By not providing "Findglog.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "glog", but
CMake did not find one.
Could not find a package configuration file provided by "glog" with any of
the following names:
glogConfig.cmake
glog-config.cmake
Add the installation prefix of "glog" to CMAKE_PREFIX_PATH or set
"glog_DIR" to a directory containing one of the above files. If "glog"
provides a separate development package or SDK, be sure it has been
installed.
Any clue ?
Best regards
The text was updated successfully, but these errors were encountered:
I'm afraid I can't really help without seeing the full CMake invocations (of the Glog configuration, build, and installation, and the same for your own project), CMakeLists.txt file, toolchain file, and directory layout.
Hi !
Thanks a lot for your work, it helped me a lot to finally get into cross compile world.
I need to add a library (GLog) into my project but I'm struggling to make it work.
In the CMakeLists.txt of Glog, I added :
It got Build without any error, but when I add just a little 'find_package (glog REQUIRED)' in the CMakeLists.txt of my Project, I get:
Any clue ?
Best regards
The text was updated successfully, but these errors were encountered: