mingw-cross-env-list
[Top][All Lists]
Advanced

[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: Tony Theodore
Subject: Re: CMake 2.8.4 problems (was Re: [Mingw-cross-env-list] Release 2.19)
Date: Thu, 17 Mar 2011 05:09:33 +1100

Hi Daniel,

Thanks for the tips.

On 16 March 2011 17:39, Daniel Stonier <address@hidden> wrote:
> 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.

I removed them anyway, and added BUILD_SHARED_LIBS which seems to be
the only global built-in flag for static building. Each project seems
to make up their own variants (LIBTYPE=STATIC, ENABLE_STATIC=ON)
though, so I've left those in the respective makefiles.

> 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.

Initially, I thought I'd use the cache for everything, but it seems to
be very fussy about absolute paths, (not) quoting, and rebuilding the
cache when it sees fit (which then ignores other options). I'll stick
to setting the CACHE param as you advised below.

> 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.")

That works perfectly, and I also had to cache the CMAKE_BUILD_TYPE setting.

Thanks again, I've checked these changes in:

http://hg.savannah.gnu.org/hgweb/mingw-cross-env/rev/5ebd455fc306

along with Volker's comments.

Cheers,

Tony



reply via email to

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