[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CMake 2.8.4 problems (was Re: [Mingw-cross-env-list] Release 2.19)

From: Daniel Stonier
Subject: Re: CMake 2.8.4 problems (was Re: [Mingw-cross-env-list] Release 2.19)
Date: Wed, 16 Mar 2011 15:39:08 +0900

On 16 March 2011 01:08, Tony Theodore <address@hidden> wrote:
> On 16 March 2011 01:54, Daniel Stonier <address@hidden> wrote:
>> On 15 March 2011 23:36, Mark Brand <address@hidden> wrote:
>>>> The latest version of CMake (2.8.4) requires a new CMAKE_RC_COMPILER
>>>> option. This breaks all five packages [1] that use it. I've added the
>>>> option
>>> Just a tiny nitpick: I don't like having those escape backslashes
>>> right-justified. The simple reason is that when the width changes, all the
>>> lines change, which makes the patch much harder to review.
> Hi Mark,
> I don't like them either (along with the capitals), it's what made me
> think about the toolchain file in the first place ;)
>>>> , but wonder if we should create a toolchain file
>>>> [2].
>>>> I don't know too much about CMake, does anyone have experience with this?
>>> I don't have tremendous experience with CMake either, but the "toolchain
>>> file" looks like an elegant solution to me.
> Attached is an attempt at creating the toolchain file. I'm not sure of
> the best way to create it (there must be a better way than printf),
> when to create it, or where to put it. The packages themselves seem to
> include the file correctly.
> This is against r1655, not the previous diff.
>> I use a cmake toolchain file to build with mingw_cross in the ros
>> build environment (which is essentially a cmake build environment), is
>> that what you're looking for?
> Hi Dan,
> Could you review the attached patch and see if there's anything that
> should/shouldn't be in the toolchain file? For some reason, it ignores
> CMAKE_INSTALL_PREFIX so I've left it in each package.

Looks fine. You don't need the CMAKE_INCLUDE_PATH and CMAKE_LIB_PATH
in there as it will automatically find these from the
CMAKE_FIND_ROOT_PATH anyway, but they certainly wont hurt.

The other file that is often used in tandem with the toolchain file is
the initial cache file. You pass that to cmake via a -C argument, e.g.
a typical situation is like:

mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=/opt/ros/rostoolchain.cmake -C
/opt/ros/rosconfig.cmake ..

I usually use both because it makes the concepts cleaner and for other
types of cross compiling, separating out the cpu configuration
variables from the toolchain location is important. For this though,
anything defined in the toolchain file will go through - I suspect the
problem you had with CMAKE_INSTALL_PREFIX is that you didn't
explicitly put it in the cache and so it got overwritten when the
system defined its officalish cmake variables. See here for more
detail on using set:
http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:set. As an
example, something like the following in your toolchain file would
probably do it:

set(CMAKE_INSTALL_PREFIX "/opt/mingw/usr/i686-pc-mingw" CACHE PATH
"Installation path.")


reply via email to

[Prev in Thread] Current Thread [Next in Thread]