[CMake] cross-compiling for arm

Gunter, Walter E Walter.Gunter at dematic.com
Thu Sep 15 11:48:02 EDT 2016


I am using the arm-2008q3 toolchain and having some issues with compiling.
Doing a c++ compile for RT Linux,
I have setup the following in my main CMakeLists.txt

arm-none-linux-gnueabi-g++

cmake_minimum_required(VERSION 3.2)

project(enterprise CXX)

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_CXX_COMPILER /opt/toolchains/arm-2008q3/bin/arm-none-linux-gnueabi-g++)
set(CMAKE_C_COMPILER /opt/toolchains/arm-2008q3/bin/arm-none-linux-gnueabi-gcc)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_AR /opt/toolchains/arm-2008q3/bin/arm-none-linux-gnueabi-ar)
set(CMAKE_FIND_ROOT_PATH /mnt/root)

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_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

set(COMPILE_FLAGS "-lrt -Wall -lpthread")

set(CROSS_COMPILE_INCLUDES /opt/toolchains/arm-2008q3/arm-none-linux-gnueabi/libc/usr/include/linux)
set(LOCAL_PROJECT_HEADER_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/includes)

find_package(Threads)
add_subdirectory(src)

Here is the /src folder CMakeLists.txt



set(SOURCES  ${CMAKE_CURRENT_SOURCE_DIR}
files.cpp
)

include_directories("../includes")
set_source_files_properties(${SOURCES} PROPERTIES LANGUAGE CXX)

set(VENDOR_LIBRARY  mycan.c evgpio.c)
add_library(vendorLib ${VENDOR_LIBRARY})

set_target_properties(vendorLib PROPERTIES LINKER_LANGUAGE CXX)

add_executable(enterprise ${SOURCES})

target_link_libraries(enterprise vendorLib ${CMAKE_THREAD_LIBS_INIT} pthread event config pcan)



I am able to complete ../cmake, but when I run make, I get the following error:

arm-none-linux-gnueabi-g++: /home/wegunterjr/Documents/projects/Enterprise_Dev_cmake/src: linker input file unused because linking not done
[100%] Linking CXX executable enterprise
arm-none-linux-gnueabi-g++: CMakeFiles/enterprise.dir/..o: No such file or directory
src/CMakeFiles/enterprise.dir/build.make:485: recipe for target 'src/enterprise' failed
make[2]: *** [src/enterprise] Error 1
CMakeFiles/Makefile2:87: recipe for target 'src/CMakeFiles/enterprise.dir/all' failed
make[1]: *** [src/CMakeFiles/enterprise.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Any thoughts?

Walter E. Gunter, Jr.
Mechatronics Engineer/Roboticist
AGV R&D
Dematic North America
265 S 5200 W
Salt Lake City, UT 84104
801.715.2602

Customer Service 1.800.530.9153

DEMATIC l We Optimize Your Supply Chain  www.dematic.com<http://www.dematic.com/>

MATERIAL HANDLING & LOGISTICS CONFERENCE  www.mhlc.com<http://www.mhlc.com/>

CONFIDENTIALITY NOTICE: This email message and any attachments to it, is intended only for the individual or entity to which it is addressed and may contain confidential material. If you are not the intended recipient, or the employee or agent responsible for delivering it to the intended recipient, please do not disclose, copy, forward, or retain. If you have received this in error, please contact the sender by reply email and destroy all copies of the original message. ​

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160915/fb00778d/attachment-0001.html>


More information about the CMake mailing list