[CMake] Errors using CMAKE for cross compiling.

jianhua yujianhua1982 at 126.com
Tue Jun 14 02:55:26 EDT 2011


Thanks Kishore; 

It really works as expected after your guidence change.


At 2011-06-14 12:47:52,Kishore <kitts.mailinglists at gmail.com> wrote: >On Tuesday 14 Jun 2011 9:46:56 AM jianhua wrote: >> Try cross compiling using CMAKE, target tool chain is ARM RVCT4, got errors >> on both Windows and Ubuntu. >>  >> Please help, thanks in advance. >>  >> 1. On Ubuntu. >>  ADD_EXECUTABLE(hello main.c) >> Fatal error: C3900U: Unrecognized option '-rdynamic'. >>  >> ADD_EXECUTABLE(hello SHARED main.c) >> Fatal error: C3900U: Unrecognized option '-fPIC'. >>  >> My question: >> I don't know why such compiling options have been added automatically by >> CMAKE? armcc doesn't recognize it. >>  >> 2. On Windows XP. >> My Question: >> I have set CMAKE_C_COMPILER already, why does it still can't find it? >>  >> G:\t2\build>cmake -G "Unix Makefiles"  VERBOSE=1 .. && make VERBOSE=1 >> -- The C compiler identification is unknown >> -- The CXX compiler identification is unknown >> CMake Error: your C compiler: "CMAKE_C_COMPILER-NOTFOUND" was not found.   >> Please set CMAKE_C_COMPILER to a valid compiler path or name. CMake Error: >> your CXX compiler: "CMAKE_CXX_COMPILER-NOTFOUND" was not found.   Please >> set CMAKE_CXX_COMPILER to a valid compiler path or name. >>  >>  >> CMakeLists: >>  >> cmake_minimum_required(VERSION 2.8) >> PROJECT (HELLO) >>  >> set(RVCT40BIN  $ENV{RVCT40BIN}) >> set(RVCT40INC  $ENV{RVCT40INC}) >> set(RVCT40LIB  $ENV{RVCT40LIB}) >>  >> SET (CMAKE_SYSTEM_PROCESSOR arm) >> SET (CMAKE_CROSSCOMPILING 1) >>  >> SET(CMAKE_C_COMPILER  ${RVCT40BIN}/armcc) >> SET(CMAKE_CXX_COMPILER  ${CMAKE_C_COMPILER}) > >The above cross compiler settings should occur before the PROJECT() statement  >and ideally in a toolchain file. For start, just move the above PROJECT()  >statement to the place of this comment and try again. > >> SET (CMAKE_C_FLAGS  "--thumb --cpp -c --cpu ARM9TDMI --apcs >> /noropi/interwork/norwpi --littleend --split_sections   --diag_suppress >> 177,1165,997,611,68,161,2548 --fpu=softvfp -Ospace -O2") SET >> (CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS}) >>  >> SET (CMAKE_C_CREATE_STATIC_LIBRARY "<CMAKE_AR> --create -cr <LINK_FLAGS> >> <TARGET> <OBJECTS>") SET (CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_AR> >> --create -cr <LINK_FLAGS> <TARGET> <OBJECTS>") >>  >> INCLUDE_DIRECTORIES(${RVCT40INC}) >> LINK_DIRECTORIES(${RVCT40LIB}/armlib  ${RVCT40LIB}/cpplib) >> ADD_EXECUTABLE(hello main.c) >--  >Cheers! >Kishore >_______________________________________________ >Powered by www.kitware.com > >Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > >Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ > >Follow this link to subscribe/unsubscribe: >http://www.cmake.org/mailman/listinfo/cmake
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110614/56cd585a/attachment.htm>


More information about the CMake mailing list