[CMake] Cross compiling arm-elf on Windows host

Alexander Neundorf a.neundorf-work at gmx.net
Sun Sep 20 16:22:45 EDT 2009


On Sunday 20 September 2009, Harald Kipp wrote:
> Alexander Neundorf wrote:
> > On Sunday 20 September 2009, Harald Kipp wrote:
> >> My subdir CMakeLists:
> >>
> >> --- C:\ethernut-4.9.6\nut\fs\CMakeLists.txt ---
> >> add_library(nutfs STATIC basename dirent dirname)
> >
> > This command means that you want to build a library called "nutfs" from
> > the source files "basename", "dirent" and "dirname". Is this what you
> > want ?
>
> Yes. Actually there are more files, but I wanted to start with these
> simple ones first.

I would recommend to use the full filename, i.e. including the suffix. So 
probably basename.c etc.

> The directory structure is
>
> C:\ethernut-4.9.6
>   nut <- Source tree
>     fs <- nutlibfs sources
>     .... <- other sources
>
> >>  cmake -G "Unix Makefiles"
> >> -DCMAKE_TOOLCHAIN_FILE=c:\ethernut-4.9.6\toolchain-generic.cmake
> >> c:\ethernut-4.9.6\nut
> >>
> >> So far the result is
> >>
> >>  -- Configuring done
> >>  -- Generating done
> >>  -- Build files have been written to: C:/ethernut-4.9.6/nutbld
> >>
> >> However, when trying to run make, I get
> >
> > What "make" is it ? cygwin ? mingw ?
>
> Generally we use
> http://www.yagarto.de/
> for building arm-elf binaries on Windows. YAGARTO is build with mingw.
> However, the Ethernut developers do not need to install cygwin or mingw.
> So far all binaries run on a native Windows command shell.

I'm not completely sure here.
I think if you generate "Unix Makefiles" on Windows you may need to execute it 
from a mingw shell or something like this. But I'm not sure.

> >>   Scanning dependencies of target nutfs
> >>   [ 33%] Building C object fs/CMakeFiles/nutfs.dir/basename.c.obj
> >>   Das System kann den angegebenen Pfad nicht finden.
> >
> > Try "VERBOSE=1 make" to see the full command which is executed.
>
> I'll try to do this tommorrow.
>
> >>   cd C:/ethernut-4.9.6/nutbld && "C:/Programm....
> >>
> >> I think that this will not work on Windows. cd requires backslashes.
> >
> > I think this depends on the type of makefiles you generate and on the
> > type of make/shell you use to execute them.
> > You might try the nmake makefiles in case you have nmake.
>
> I'll try this as well.
>
> One reason for looking at CMake as an alternative to GNU autotools is,
> that we do not want to force Windows users to install Cygwin or force OS
> X users to install fink. It'd be great if CMake can help here.

Should do.

Alex


More information about the CMake mailing list