[Insight-users] CMake configuration for ITK

Ofri Sadowsky ofri@cs.jhu.edu
Mon, 03 Feb 2003 10:13:19 -0500


Hi,

I am trying to build some ITK-related modules in the Slicer framework,
with partial success. One problem that keeps recurring is the following
warning message:

SEND_WARNINGThe selected ITK was built with C++ compiler flags "
 -ftemplate-depth-50   -I/usr/X11R6/include", but the current flags are
"
 -I/usr/X11R6/include".  Please set CMAKE_CXX_FLAGS to "
-ftemplate-depth-50
 -I/usr/X11R6/include".


It appears when I run ccmake in the ITK_HOME directory. This does not
disturb the build of ITK, but it does interfere with the build of the
Slicer-2 modules. Namely, a script provided by the Slicer group for
automatic build of the modules fails, though I was able to build the
module when I ran cmake and ccmake manually.

I looked into some of the cmake-related files in the ITK_HOME, and found
that this setting has been made in ITKConfig.cmake, and might have
followed a conditional in itkCMakeOptions.cmake:

IF(CMAKE_COMPILER_IS_GNUCXX)
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth-50")
  IF(APPLE)
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-long-double")
  ENDIF(APPLE)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)

I am using gcc/g++.

Is there a specific reason for this setting? Not being a cmake expert, I
should also ask what the appropriate way to remove it is.


Thanks,

Ofri.