[Insight-users] Re: [Cmake] ITK Projects and CMake, esp. w/ OS X

Brad King brad.king@kitware.com
Fri, 31 Jan 2003 16:40:13 -0500 (EST)


Hi John,

> CMake 1.6 automatically added several CXX flags when building ITK, and
> now want's every program that uses ITK to have the same flags.  What is
> the proper way of handling this?  Should I set them in CMakeLists.txt
> just before including the ITK module?  Will that break other platforms
> though?

I've just committed changes to ITK that will let CMake automatically
adjust your project's flags correctly.  Please update your CVS checkout of
ITK and try it now.  Let me know if the behavior has improved.

> Also, what is the correct, cross platform CMake way of specifying that
> debugging should be enabled and that all warnings should be displayed?

There is no way to force debugging across all platforms from a
CMakeLists.txt file.  On windows, Debug and Release configurations are
always generated, and the user selects one from the GUI during a build.

On unix, the user can set the CMAKE_BUILD_TYPE cache entry to "Debug" when
running cmake before a build.

>From the CMakeLists.txt one can, however, get debug flags always on unix
platforms.  Just add

  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")

and it will always add the debugging flags to the generated makefiles.
This is not recommended, though.

-Brad