0

i try to cross-compile my app to Raspberry Pi with docker.

  1. I built image with necessary dependencies from armhf architecture (protobuf-compiler-grpc:armhf libgrpc-dev:armhf libgrpc++-dev:armhf libprotobuf-dev:armhf libcpprest-dev:armhf libboost-dev:armhf). dependencies installed via apt-get from port.ubuntu.com repo.

  2. After starting cmake with following args:

./cross-rpi-final cmake -DCASABLANCA_INCLUDE_DIR=/usr/include/cpprest -DCASABLANCA_LIBRARIES=/usr/lib/arm-linux-gnueabihf -DBOOST_INCLUDEDIR=/usr/include/boost -DProtobuf_INCLUDE_DIR=/usr/lib/arm-linux-gnueabihf -DGRPC_ROOT_DIR=/usr -DGRPC_INCLUDE_DIR=/usr/include/grpc -DGRPC_LIBRARIES=/usr/lib -DGRPCPP_UNSECURE_LIBRARIES=/usr/lib -DGPR_LIBRARIES=/usr/lib -DOPENSSL_INCLUDE_DIR=/usr/include/openssl -DOPENSSL_CRYPTO_LIBRARY=/usr/lib/arm-linux-gnueabihf -DGW_CORE_LINUX_FIND_GRPC_AND_PROTOBUF_WITHOUT_CMAKE_CONFIGS=ON app-gw-linux

Part of required libs is find by cmake, but Casablanca and Boost is not found.

Output after cmake execution:

-- Version: 1.6.1.2, Rev: 64730c0 + lib-gw-core-linux + lib-gw-core + commons Configure as multiple libs + core + transport + rules engine + json11 + gw-core + gw-core-linux-dev-console + cxxopts + tinyb patching file /work/app-gw-linux/lib-gw-core-linux/tinyb/src/CMakeLists.txt Reversed (or previously applied) patch detected! Assume -R? [n] Apply anyway? [n] Skipping patch. 2 out of 2 hunks ignored CMake Warning at lib-gw-core-linux/tinyb/CMakeLists.txt:26 (message): - Install git to compile a production libtinyb! INFO - libtinyb Version v0.5.0-dirty + gw-core-linux -- Could NOT find Casablanca, try to set the path to Casablanca root folder in the system variable CASABLANCA_ROOT_DIR (missing: CASABLANCA_LIBRARIES) CMake Warning at /usr/share/cmake-3.11/Modules/FindBoost.cmake:587 (message): Imported targets and dependency information not available for Boost version (all versions older than 1.33) Call Stack (most recent call first): /usr/share/cmake-3.11/Modules/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES) /usr/share/cmake-3.11/Modules/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES) lib-gw-core-linux/gw-core-linux/CMakeLists.txt:163 (find_package) CMake Warning at /usr/share/cmake-3.11/Modules/FindBoost.cmake:587 (message): Imported targets and dependency information not available for Boost version (all versions older than 1.33) Call Stack (most recent call first): /usr/share/cmake-3.11/Modules/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES) /usr/share/cmake-3.11/Modules/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES) lib-gw-core-linux/gw-core-linux/CMakeLists.txt:163 (find_package) CMake Warning at /usr/share/cmake-3.11/Modules/FindBoost.cmake:587 (message): Imported targets and dependency information not available for Boost version (all versions older than 1.33) Call Stack (most recent call first): /usr/share/cmake-3.11/Modules/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES) /usr/share/cmake-3.11/Modules/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES) lib-gw-core-linux/gw-core-linux/CMakeLists.txt:163 (find_package) CMake Error at /usr/share/cmake-3.11/Modules/FindBoost.cmake:2044 (message): Unable to find the requested Boost libraries. Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers. Call Stack (most recent call first): lib-gw-core-linux/gw-core-linux/CMakeLists.txt:163 (find_package) CMake Error at lib-gw-core-linux/gw-core-linux/cmake/FindProtobuf.cmake:425 (file): file STRINGS file "/usr/lib/arm-linux-gnueabihf/google/protobuf/stubs/common.h" cannot be read. Call Stack (most recent call first): lib-gw-core-linux/gw-core-linux/CMakeLists.txt:176 (find_package) CMake Error at lib-gw-core-linux/gw-core-linux/cmake/FindProtobuf.cmake:431 (math): math cannot parse the expression: " / 1000000": syntax error, unexpected exp_DIVIDE, expecting exp_PLUS or exp_MINUS or exp_OPENPARENT or exp_NUMBER (2) Call Stack (most recent call first): lib-gw-core-linux/gw-core-linux/CMakeLists.txt:176 (find_package) CMake Error at lib-gw-core-linux/gw-core-linux/cmake/FindProtobuf.cmake:432 (math): math cannot parse the expression: " / 1000 % 1000": syntax error, unexpected exp_DIVIDE, expecting exp_PLUS or exp_MINUS or exp_OPENPARENT or exp_NUMBER (2) Call Stack (most recent call first): lib-gw-core-linux/gw-core-linux/CMakeLists.txt:176 (find_package) CMake Error at lib-gw-core-linux/gw-core-linux/cmake/FindProtobuf.cmake:433 (math): math cannot parse the expression: " % 1000": syntax error, unexpected exp_MOD, expecting exp_PLUS or exp_MINUS or exp_OPENPARENT or exp_NUMBER (2) Call Stack (most recent call first): lib-gw-core-linux/gw-core-linux/CMakeLists.txt:176 (find_package) CMake Warning at lib-gw-core-linux/gw-core-linux/cmake/FindProtobuf.cmake:455 (message): Protobuf compiler version 3.0.0 doesn't match library version .. Call Stack (most recent call first): lib-gw-core-linux/gw-core-linux/CMakeLists.txt:176 (find_package) -- Using protobuf -- Using gRPC -- SOURCE FILES include/milfei/gw/core/lnx/bt/LnxBleScanner.hpp;src/milfei/gw/core/lnx/bt/LnxBleScanner.cpp;include/milfei/gw/core/lnx/bt/LnxBluetoothAdapter.hpp;src/milfei/gw/core/lnx/bt/LnxBluetoothAdapter.cpp;include/milfei/gw/core/lnx/bt/LnxBluetoothDevice.hpp;src/milfei/gw/core/lnx/bt/LnxBluetoothDevice.cpp;include/milfei/gw/core/lnx/bt/LnxGatt.hpp;src/milfei/gw/core/lnx/bt/LnxGatt.cpp;include/milfei/gw/core/lnx/bt/LnxCharacteristic.hpp;src/milfei/gw/core/lnx/bt/LnxCharacteristic.cpp;src/milfei/gw/core/lnx/app/DevicesListenerImpl.hpp;src/milfei/gw/core/lnx/app/DevicesListenerImpl.cpp;include/milfei/gw/core/lnx/app/App.hpp;src/milfei/gw/core/lnx/app/App.cpp;src/milfei/gw/core/lnx/app/TerminalApp.cpp;src/milfei/gw/core/lnx/app/TerminalApp.hpp;src/milfei/gw/core/lnx/app/SimpleTerminalApp.cpp;src/milfei/gw/core/lnx/app/SimpleTerminalApp.hpp;src/milfei/gw/core/lnx/app/cmd/CommandEnvironment.hpp;src/milfei/gw/core/lnx/app/cmd/CommandEnvironment.cpp;src/milfei/gw/core/lnx/app/cmd/CommandInteractiveCloneable.hpp;src/milfei/gw/core/lnx/app/cmd/CommandInteractive.hpp;src/milfei/gw/core/lnx/app/cmd/CommandInteractive.cpp;src/milfei/gw/core/lnx/app/cmd/CommandMeta.hpp;src/milfei/gw/core/lnx/app/cmd/CommandMeta.cpp;src/milfei/gw/core/lnx/app/cmd/SwitchOnOff.hpp;src/milfei/gw/core/lnx/app/cmd/SwitchOnOff.cpp;src/milfei/gw/core/lnx/app/rpc/RequestDispatcher.hpp;src/milfei/gw/core/lnx/app/rpc/CommandDataEvent.hpp;src/milfei/gw/core/lnx/app/cmd/Rename.hpp;src/milfei/gw/core/lnx/app/cmd/Rename.cpp;src/milfei/gw/core/lnx/app/cmd/GatewayInfo.hpp;src/milfei/gw/core/lnx/app/cmd/GatewayInfo.cpp;src/milfei/gw/core/lnx/app/cmd/Help.hpp;src/milfei/gw/core/lnx/app/cmd/Help.cpp;src/milfei/gw/core/lnx/app/cmd/Welcome.hpp;src/milfei/gw/core/lnx/app/cmd/Welcome.cpp;src/milfei/gw/core/lnx/app/cmd/Login.cpp;src/milfei/gw/core/lnx/app/cmd/Login.hpp;src/milfei/gw/core/lnx/app/cmd/Logout.cpp;src/milfei/gw/core/lnx/app/cmd/Logout.hpp;src/milfei/gw/core/lnx/app/cmd/CommandLauncherDefault.hpp;src/milfei/gw/core/lnx/app/rpc/Login.hpp;src/milfei/gw/core/lnx/app/rpc/Login.cpp;src/milfei/gw/core/lnx/app/rpc/Logout.cpp;src/milfei/gw/core/lnx/app/rpc/Logout.hpp;src/milfei/gw/core/lnx/app/rpc/Switch.hpp;src/milfei/gw/core/lnx/app/rpc/Switch.cpp;src/milfei/gw/core/lnx/app/rpc/Rename.cpp;src/milfei/gw/core/lnx/app/rpc/Rename.hpp;src/milfei/gw/core/lnx/app/rpc/RenameCommand.hpp;src/milfei/gw/core/lnx/app/rpc/RenameCommand.cpp;src/milfei/gw/core/lnx/app/rpc/SwitchCommand.hpp;src/milfei/gw/core/lnx/app/rpc/SwitchCommand.cpp;src/milfei/gw/core/lnx/app/rpc/LogoutCommand.hpp;src/milfei/gw/core/lnx/app/rpc/LogoutCommand.cpp;src/milfei/gw/core/lnx/app/rpc/CommandResultDefault.hpp;src/milfei/gw/core/lnx/app/rpc/CommandResultDefault.cpp;src/milfei/gw/core/lnx/app/rpc/LoginCommand.cpp;src/milfei/gw/core/lnx/app/rpc/LoginCommand.hpp;src/milfei/gw/core/lnx/app/rpc/GatewayInfo.hpp;src/milfei/gw/core/lnx/app/rpc/GatewayInfo.cpp;src/milfei/gw/core/lnx/app/rpc/GatewayInfoCommand.hpp;src/milfei/gw/core/lnx/app/rpc/GatewayInfoCommand.cpp;src/milfei/gw/core/lnx/app/rpc/CommandsInvoker.hpp;src/milfei/gw/core/lnx/app/rpc/CommandsInvoker.cpp;src/milfei/gw/core/lnx/app/rpc/CommandWrapper.hpp;src/milfei/gw/core/lnx/app/rpc/CommandRemote.hpp;src/milfei/gw/core/lnx/app/rpc/CommandContext.hpp;src/milfei/gw/core/lnx/app/rpc/CommandContext.cpp;src/milfei/gw/core/lnx/app/rpc/GrpcServer.hpp;src/milfei/gw/core/lnx/app/rpc/GrpcServer.cpp;src/milfei/gw/core/lnx/app/rpc/GrpcClient.hpp;src/milfei/gw/core/lnx/app/rpc/GrpcClient.cpp;src/milfei/gw/core/lnx/app/rpc/GWServiceImpl.hpp;src/milfei/gw/core/lnx/app/rpc/GWServiceImpl.cpp;src/milfei/gw/core/lnx/app/rpc/ServiceCommandsSender.hpp;src/milfei/gw/core/lnx/app/TerminalAppClient.cpp;src/milfei/gw/core/lnx/app/TerminalAppClient.hpp;src/milfei/gw/core/lnx/app/Credentials.hpp;src/milfei/gw/core/lnx/app/Urls.hpp;src/milfei/gw/core/lnx/app/TerminalAppService.cpp;src/milfei/gw/core/lnx/app/TerminalAppService.hpp;src/milfei/gw/core/lnx/app/LnxEnvironment.cpp;src/milfei/gw/core/lnx/app/LnxEnvironment.hpp;src/milfei/gw/core/lnx/app/LnxBatteryStateMonitor.cpp;src/milfei/gw/core/lnx/app/LnxBatteryStateMonitor.hpp;src/milfei/gw/core/lnx/storage/LnxKeyValueStorage.cpp;src/milfei/gw/core/lnx/storage/LnxKeyValueStorage.hpp;src/milfei/gw/core/lnx/io/IOUtils.hpp;src/milfei/gw/core/lnx/io/IOUtils.cpp;src/milfei/gw/core/lnx/http/LnxHttpClient.cpp;src/milfei/gw/core/lnx/http/LnxHttpClient.hpp;src/milfei/gw/core/lnx/http/LnxHttpCall.cpp;src/milfei/gw/core/lnx/http/LnxHttpCall.hpp;src/milfei/gw/core/lnx/cloud/aws/AwsCloudClient.cpp;include/milfei/gw/core/lnx/cloud/aws/AwsCloudClient.hpp;src/milfei/gw/core/lnx/cloud/LnxCloudClientFactory.cpp;include/milfei/gw/core/lnx/cloud/LnxCloudClientFactory.hpp;/work/lib-gw-core-linux/gw-core-linux/gwservice.pb.cc;/work/lib-gw-core-linux/gw-core-linux/gwservice.grpc.pb.cc + aws-iot-device-sdk-cpp -- Configuring done -- Generating done -- Build files have been written to: /work/third_party/rapidjson/download [100%] Built target rapidjson -- The following OPTIONAL packages have been found: * Doxygen * Git -- The following REQUIRED packages have been found: * Protobuf * gRPC * PkgConfig * OpenSSL * Threads -- The following features have been disabled: * SharedLibrary, build the library as shared objects * Cli, the command line interface * Samples, example programs making use of the SDK * Tests, unit and integration tests * Docs, HTML based API documentation -- The following REQUIRED packages have not been found: * Casablanca * Boost -- Configuring incomplete, errors occurred! See also "/work/CMakeFiles/CMakeOutput.log". See also "/work/CMakeFiles/CMakeError.log". 

Maybe reason of this trouble its a libraries of another architecture (armhf)? Host where placed crosscompiling container is server with AMD64 arch.

How i can set path to all libraries correctly and fix this problem?

CMakeLists.txt:

cmake_minimum_required(VERSION 4.7) project(app_gw_linux VERSION 1.6.1.2) set(CMAKE_CXX_STANDARD 11) option(APP_GW_LINUX_MOCK_BLUETOOTH "Use mock bluetooth API" Off) if (APP_GW_LINUX_MOCK_BLUETOOTH) set(GW_CORE_LINUX_MOCK_BLUETOOTH On CACHE BOOL "Use mock bluetooth API" FORCE) endif () set(APP_GW_LINUX_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) set(APP_GW_LINUX_VERSION_MINOR ${PROJECT_VERSION_MINOR}) set(APP_GW_LINUX_VERSION_PATCH ${PROJECT_VERSION_PATCH}) set(APP_GW_LINUX_VERSION_TWEAK ${PROJECT_VERSION_TWEAK}) find_package(Git) if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git") # Get the latest abbreviated commit hash of the working branch execute_process( COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE APP_GW_LINUX_VERSION_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE ) else() message(WARNING "Git not found, cannot set version info") SET(APP_GW_LINUX_VERSION_REVISION "unknown") endif() message(STATUS "Version: ${PROJECT_VERSION}, Rev: ${APP_GW_LINUX_VERSION_REVISION}") message(" + lib-gw-core-linux") add_subdirectory(lib-gw-core-linux) include_directories(src lib-gw-core-linux/gw-core-linux/include) set(SOURCE_FILES src/milfei/gw/lnx/Main.cpp) add_executable(app-gw-linux ${SOURCE_FILES}) install(TARGETS app-gw-linux DESTINATION local/bin COMPONENT bin) install(FILES app-gw-linux.service DESTINATION /etc/systemd/system COMPONENT bin) install(FILES ${CMAKE_BINARY_DIR}/bin/certs/verisign-class-3-public-primary-ca-g5.pem DESTINATION /etc/company/.agilegateway RENAME ca.pem COMPONENT bin) set(TARGET_NAME app-gw-linux) add_custom_command(TARGET ${TARGET_NAME} PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/bin/certs $<TARGET_FILE_DIR:${TARGET_NAME}>/certs) target_link_libraries(app-gw-linux gw-core-linux) if (NOT APP_GW_LINUX_MOCK_BLUETOOTH) target_link_libraries(app-gw-linux tinyb) endif () SET(CPACK_GENERATOR "DEB") set(CPACK_DEB_COMPONENT_INSTALL ON) SET(CPACK_COMPONENTS_ALL "bin") SET(CPACK_PACKAGE_NAME "app-gw-linux") SET(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) SET(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) SET(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) SET(CPACK_PACKAGE_VERSION_TWEAK ${PROJECT_VERSION_TWEAK}) SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}.${CPACK_PACKAGE_VERSION_TWEAK}") SET(CPACK_PACKAGE_CONTACT "[email protected]") SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "company.com") SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libcpprest2.10 | libcpprest2.9, libgrpc3 (>= 1.10), libgrpc++1 (>= 1.10)") SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/debian/postinst;${CMAKE_CURRENT_SOURCE_DIR}/debian/preinst;${CMAKE_CURRENT_SOURCE_DIR}/debian/prerm;${CMAKE_CURRENT_SOURCE_DIR}/debian/postrm") INCLUDE(CPack) 

UPD. Boost output with debug log:

-- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1121 ] _boost_TEST_VERSIONS = 1.67.0;1.67;1.66.0;1.66;1.65.1;1.65.0;1.65 -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1123 ] Boost_USE_MULTITHREADED = ON -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1125 ] Boost_USE_STATIC_LIBS = ON -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1127 ] Boost_USE_STATIC_RUNTIME = OFF -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1129 ] Boost_ADDITIONAL_VERSIONS = -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1131 ] Boost_NO_SYSTEM_PATHS = -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1199 ] Declared as CMake or Environmental Variables: -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1201 ] BOOST_ROOT = /usr/local/boost -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1203 ] BOOST_INCLUDEDIR = /usr/local/boost/include/boost -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1205 ] BOOST_LIBRARYDIR = /usr/local/boost/lib -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1207 ] _boost_TEST_VERSIONS = 1.67.0;1.67;1.66.0;1.66;1.65.1;1.65.0;1.65 -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1282 ] Include debugging info: -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1284 ] _boost_INCLUDE_SEARCH_DIRS = /usr/local/boost/include/boost;/usr/local/boost/include;/usr/local/boost;PATHS;C:/boost/include;C:/boost;/sw/local/include -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1286 ] _boost_PATH_SUFFIXES = boost-1_67_0;boost_1_67_0;boost/boost-1_67_0;boost/boost_1_67_0;boost-1_67;boost_1_67;boost/boost-1_67;boost/boost_1_67;boost-1_66_0;boost_1_66_0;boost/boost-1_66_0;boost/boost_1_66_0;boost-1_66;boost_1_66;boost/boost-1_66;boost/boost_1_66;boost-1_65_1;boost_1_65_1;boost/boost-1_65_1;boost/boost_1_65_1;boost-1_65_0;boost_1_65_0;boost/boost-1_65_0;boost/boost_1_65_0;boost-1_65;boost_1_65;boost/boost-1_65;boost/boost_1_65 -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1416 ] guessed _boost_COMPILER = -gcc -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1426 ] _boost_MULTITHREADED = -mt -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1502 ] _boost_RELEASE_ABI_TAG = - -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1504 ] _boost_DEBUG_ABI_TAG = -d -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1567 ] _boost_LIBRARY_SEARCH_DIRS_RELEASE = /usr/local/boost/lib;/usr/local/boost/lib;/usr/local/boost/stage/lib;Boost_INCLUDE_DIR-NOTFOUND/lib;Boost_INCLUDE_DIR-NOTFOUND/../lib;Boost_INCLUDE_DIR-NOTFOUND/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib_boost_LIBRARY_SEARCH_DIRS_DEBUG = /usr/local/boost/lib;/usr/local/boost/lib;/usr/local/boost/stage/lib;Boost_INCLUDE_DIR-NOTFOUND/lib;Boost_INCLUDE_DIR-NOTFOUND/../lib;Boost_INCLUDE_DIR-NOTFOUND/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib CMake Warning at /usr/share/cmake-3.11/Modules/FindBoost.cmake:587 (message): Imported targets and dependency information not available for Boost version (all versions older than 1.33) Call Stack (most recent call first): /usr/share/cmake-3.11/Modules/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES) /usr/share/cmake-3.11/Modules/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES) lib-gw-core-linux/gw-core-linux/CMakeLists.txt:165 (find_package) CMake Warning at /usr/share/cmake-3.11/Modules/FindBoost.cmake:587 (message): Imported targets and dependency information not available for Boost version (all versions older than 1.33) Call Stack (most recent call first): /usr/share/cmake-3.11/Modules/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES) /usr/share/cmake-3.11/Modules/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES) lib-gw-core-linux/gw-core-linux/CMakeLists.txt:165 (find_package) CMake Warning at /usr/share/cmake-3.11/Modules/FindBoost.cmake:587 (message): Imported targets and dependency information not available for Boost version (all versions older than 1.33) Call Stack (most recent call first): /usr/share/cmake-3.11/Modules/FindBoost.cmake:950 (_Boost_COMPONENT_DEPENDENCIES) /usr/share/cmake-3.11/Modules/FindBoost.cmake:1618 (_Boost_MISSING_DEPENDENCIES) lib-gw-core-linux/gw-core-linux/CMakeLists.txt:165 (find_package) -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1756 ] Searching for SYSTEM_LIBRARY_RELEASE: boost_system-gcc-mt-;boost_system-gcc-mt;boost_system-mt-;boost_system-mt;boost_system -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1809 ] Searching for SYSTEM_LIBRARY_DEBUG: boost_system-gcc-mt-d-;boost_system-gcc-mt-d;boost_system-mt-d-;boost_system-mt-d;boost_system-mt;boost_system -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1756 ] Searching for CHRONO_LIBRARY_RELEASE: boost_chrono-gcc-mt-;boost_chrono-gcc-mt;boost_chrono-mt-;boost_chrono-mt;boost_chrono -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1809 ] Searching for CHRONO_LIBRARY_DEBUG: boost_chrono-gcc-mt-d-;boost_chrono-gcc-mt-d;boost_chrono-mt-d-;boost_chrono-mt-d;boost_chrono-mt;boost_chrono -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1756 ] Searching for THREAD_LIBRARY_RELEASE: boost_thread-gcc-mt-;boost_thread-gcc-mt;boost_thread-mt-;boost_thread-mt;boost_thread -- [ /usr/share/cmake-3.11/Modules/FindBoost.cmake:1809 ] Searching for THREAD_LIBRARY_DEBUG: boost_thread-gcc-mt-d-;boost_thread-gcc-mt-d;boost_thread-mt-d-;boost_thread-mt-d;boost_thread-mt;boost_thread CMake Error at /usr/share/cmake-3.11/Modules/FindBoost.cmake:2044 (message): Unable to find the requested Boost libraries. Unable to find the Boost header files. Please set BOOST_ROOT to the root directory containing Boost or BOOST_INCLUDEDIR to the directory containing Boost's headers. Call Stack (most recent call first): lib-gw-core-linux/gw-core-linux/CMakeLists.txt:165 (find_package) CMake Error at lib-gw-core-linux/gw-core-linux/cmake/FindProtobuf.cmake:425 (file): file STRINGS file "/usr/lib/arm-linux-gnueabihf/google/protobuf/stubs/common.h" cannot be read. Call Stack (most recent call first): lib-gw-core-linux/gw-core-linux/CMakeLists.txt:182 (find_package) CMake Error at lib-gw-core-linux/gw-core-linux/cmake/FindProtobuf.cmake:431 (math): math cannot parse the expression: " / 1000000": syntax error, unexpected exp_DIVIDE, expecting exp_PLUS or exp_MINUS or exp_OPENPARENT or exp_NUMBER (2) Call Stack (most recent call first): lib-gw-core-linux/gw-core-linux/CMakeLists.txt:182 (find_package) CMake Error at lib-gw-core-linux/gw-core-linux/cmake/FindProtobuf.cmake:432 (math): math cannot parse the expression: " / 1000 % 1000": syntax error, unexpected exp_DIVIDE, expecting exp_PLUS or exp_MINUS or exp_OPENPARENT or exp_NUMBER (2) Call Stack (most recent call first): lib-gw-core-linux/gw-core-linux/CMakeLists.txt:182 (find_package) CMake Error at lib-gw-core-linux/gw-core-linux/cmake/FindProtobuf.cmake:433 (math): math cannot parse the expression: " % 1000": syntax error, unexpected exp_MOD, expecting exp_PLUS or exp_MINUS or exp_OPENPARENT or exp_NUMBER (2) Call Stack (most recent call first): lib-gw-core-linux/gw-core-linux/CMakeLists.txt:182 (find_package) CMake Warning at lib-gw-core-linux/gw-core-linux/cmake/FindProtobuf.cmake:455 (message): Protobuf compiler version 3.0.0 doesn't match library version .. Call Stack (most recent call first): lib-gw-core-linux/gw-core-linux/CMakeLists.txt:182 (find_package) 

And Toolchain config:

set(CMAKE_SYSTEM_NAME Generic) set(CMAKE_SYSTEM_VERSION 1) set(CMAKE_SYSTEM_PROCESSOR arm) set(cross_triple "arm-linux-gnueabihf") set(CMAKE_C_COMPILER $ENV{CC}) set(CMAKE_CXX_COMPILER $ENV{CXX}) set(CMAKE_Fortran_COMPILER $ENV{FC}) set(CMAKE_FIND_ROOT_PATH $ENV{CROSS_ROOT} $ENV{CROSS_ROOT}/libc/usr) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_CROSSCOMPILING_EMULATOR /usr/bin/qemu-arm) 
6
  • If prefer to use conan for this. With conan you can easily build missing libraries. It will set the paths for you. Commented Nov 8, 2018 at 15:56
  • Can you post your CMakeLists.txt file? Commented Nov 9, 2018 at 2:57
  • Jose Fernando Lopez Fernandez, pasted CMakeLists.txt in edited post. Commented Nov 9, 2018 at 6:22
  • From the errors, it looks like you need to specify where Casablanca and Boost are, which you can do by using CMAKE_MODULE_PATH, CMAKE_PREFIX_PATH, setting the BOOST_ROOT, etc. Commented Nov 9, 2018 at 18:23
  • I start cmake with parameters: cmake -DBOOST_ROOT=/usr/local/boost -DBOOST_INCLUDEDIR=/usr/local/boost/include/boost -DBOOST_LIBRARYDIR=/usr/local/boost/lib -DProtobuf_INCLUDE_DIR=/usr/lib/arm-linux-gnueabihf -DGRPC_ROOT_DIR=/usr -DGRPC_INCLUDE_DIR=/usr/include/grpc -DGRPC_LIBRARIES=/usr/lib -DGRPCPP_UNSECURE_LIBRARIES=/usr/lib -DGPR_LIBRARIES=/usr/lib -DOPENSSL_INCLUDE_DIR=/usr/include/openssl -DOPENSSL_CRYPTO_LIBRARY=/usr/lib/arm-linux-gnueabihf -DGW_CORE_LINUX_FIND_GRPC_AND_PROTOBUF_WITHOUT_CMAKE_CONFIGS=ON app-gw-linux And cmake doesn't see boost :( Commented Nov 12, 2018 at 15:41

1 Answer 1

0

Solved, i just changed path $ENV{CROSS_ROOT}/libc/usr to /usr and all works fine.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.