linux x86软件改arm,x86程序移植到arm上

1.将arm系统做到SD卡上

2.在arm系统上安装编译好需要的库文件

3.使用arm上系统自带的编译器

4.主要还是cmakelist需要写好

参考如下CMakeLists.txt

/home/wey为本机电脑目录

/media/wey为本机SD卡的目录

# this is required

SET(CMAKE_SYSTEM_NAME Linux)

SET(SYS_APTH /media/wey/46a7e02a-7e0d-4312-b587-8a01b57f9c35 )

# specify the cross compiler

SET(CMAKE_CXX_COMPILER   /home/wey/gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-g++)

#SET(CMAKE_C_COMPILER /home/zhk/gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc-6.2.1)

# where is the target environment

SET(CMAKE_FIND_ROOT_PATH  /home/wey/gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu/

/media/wey/46a7e02a-7e0d-4312-b587-8a01b57f9c35)

# search for programs in the build host directories (not necessary)

SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

# for libraries and headers in the target directories

#SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)

#SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)

SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)

# configure Boost and Qt

#SET(QT_QMAKE_EXECUTABLE /opt/qt-embedded/qmake)

SET(BOOST_ROOT /media/wey/46a7e02a-7e0d-4312-b587-8a01b57f9c35/boost_1_58_0)

cmake_minimum_required(VERSION 3.1)

project(zte_test)

find_package(Boost REQUIRED COMPONENTS system thread timer chrono date_time program_options serialization graph regex filesystem)

message("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")

message(${Boost_INCLUDE_DIRS})

message(${Boost_LIBRARY_DIRS})

message(${Boost_LIBRARIES})

message("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")

include_directories(

${SYS_APTH}/usr/local/include

${Boost_INCLUDE_DIRS}

${CMAKE_SOURCE_DIR}/include

${CMAKE_SOURCE_DIR}

${CMAKE_SOURCE_DIR}/tracking

${SYS_APTH}/opt/qt5.4.1arm64/include

)

link_directories(

${SYS_APTH}/lib/aarch64-linux-gnu

${SYS_APTH}/usr/local/lib/

${Boost_LIBRARY_DIRS}

${SYS_APTH}/opt/qt5.4.1arm64/lib

)

file(GLOB project_HEADERS *.h ./lcmtypes/*.h ./mybasic/*.h ./include/scanio/*.h ./include/slam6d/*.h ./SensorProcessing/*.h ./GLPainting/*.h ./lcmtypes/camera/*.hpp ./lcmtypes/LIDAR_OBJECY_SIDE/*.hpp ./lcmtypes/ESR_REAR_DATA/*.hpp ./lcmtypes/*.hpp)

file(GLOB project_SOURCES *.h *.cpp *.hpp *.cc ./lcmtypes/*.c ./lcmtypes/*.hpp ./mybasic/*.cpp ./mybasic/*.h ./slam6d/*.cc ./SensorProcessing/*.cpp ./GLPainting/*.cpp)

add_executable(${PROJECT_NAME} ${project_SOURCES} ${project_HEADERS} ${project_FORMS_HEADERS} ${project_HEADERS_MOC})

TARGET_LINK_LIBRARIES (${PROJECT_NAME} -llcm ${Boost_LIBRARIES} -ldl -lpthread )# $    {VTK_LIBRARIES} ${PCL_LIBRARIES} ann newmat cxsparse

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值