On Wed, Mar 11, 2009 at 9:52 AM, Vladimir Prus <[email protected]> wrote:
>
> Hello,
> I have cmake version '2.6-patch 2', and after I generate makefiles,
> and build with
>
>        make CFLAGS=-O2
>
> I don't see -O2 being used in the compiler command line. Is this
> the expected behaviour?
>
> I realize that CFLAGS is a automake convention, so I am not saying cmake
> should support it, but I wanted to check if maybe I have old CMake version,
> or something.

This is the expected behavior. You need to run:

 $ CFLAGS=-02 CXXFLAGS=-03 cmake /path/to/src && make

cmake is doing system inspection so it is extremely important that
both compiler and compiler flags are set prior to the very first cmake
configuration step (it will deduce pointer size for instance which
could be changed using different compiler flags)

2cts
-- 
Mathieu
_______________________________________________
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

Reply via email to