[CMake] Setting up mingw toolchain for crosscompiling from Linux
Nathan Huesken
cmake at lonely-star.org
Mon May 12 10:25:38 EDT 2008
Hi,
I removed CMakeChache.txt, I also removed the CMakeFiles folder.
Still does not use the correct gcc.
It is like it would ignore the DCMAKE_TOOLCHAIN_FILE parameter.
I want to use cmake for a project which should run under linux and windows.
Let's see how it goes :).
Greetings,
Nathan
On Sun, May 11, 2008 at 10:37:12PM +0200, Alexander Neundorf wrote:
> On Sunday 11 May 2008, Nathan Huesken wrote:
> > Hi,
> >
> > My cmake project works now!
> > Now I want to crosscompile to Windows. I am under gentoo and installed
> > mingw toolchain (which works, I can manually compile with it). Then I setup
> > the Toolchain-mingw32.cmake as suggested here:
> > http://www.cmake.org/Wiki/CmakeMingw
> >
> > # the name of the target operating system
> > SET(CMAKE_SYSTEM_NAME Windows)
> >
> > # which compilers to use for C and C++
> > SET(CMAKE_C_COMPILER i686-mingw32-gcc)
> > SET(CMAKE_CXX_COMPILER i686-mingw32-g++)
> >
> > # here is the target environment located
> > SET(CMAKE_FIND_ROOT_PATH /usr/i686-mingw32)
> >
> > # adjust the default behaviour of the FIND_XXX() commands:
> > # search headers and libraries in the target environment, search
> > # programs in the host environment
> > set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
> > set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
> > set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
> >
> > Now I try to crosscompile with this toolchain:
> > cmake -DCMAKE_TOOLCHAIN_FILE=./Toolchain-mingw32.cmake
>
> Did you do this in a clean build tree or was there already a CMakeCache.txt in
> the source dir or in the build dir ?
> If this is the case, then the settings from this CMakeCache.txt are used.
>
> Alex
>
> P.S. you are quite new to cmake, immediately starting with cross compiling is
> maybe not the easiest thing to do in the beginning, but let's see how it
> goes...
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
More information about the CMake
mailing list