[Insight-users] no CFLAGS set by cmake

Viktor Gal wiking at maeth.com
Fri Jan 28 06:18:25 EST 2011


Hi,

::: i've tried to google for the mailing list archive as i'm sure this 
problem popped up couple of times, but i couldn't find a solution till now.

::: i've installed ITK to a non-default prefix location, and now i'm 
trying to build an application based on ITK, but when i try to include 
ITK headers, gcc fails, as it cannot find the headers.

::: yes i'm using cmake, and my CMakeLists.txt looks like this:
cmake_minimum_required(VERSION 2.8)
PROJECT(test)
SET(CMAKE_MODULE_PATH "/opt/local//share/cmake-2.8/Modules/")
FIND_PACKAGE(ITK)
IF (ITK_FOUND)
     INCLUDE ($(ITK_USE_FILE))
ENDIF(ITK_FOUND)

ADD_EXECUTABLE(test test-itk-di.cc)
TARGET_LINK_LIBRARIES (test ITKCommon ITKIO ITKBasicFilters)

i've checked the CMakeFiles/test.dir/flags.make and it has no CFLAGS nor 
CXX_FLAGS set, although it should have something like an 
-I/opt/local/include/InsightToolkit/IO 
-I/opt/local/include/InsightToolkit/Common ...
so that gcc can find the headers.

::: imo it should be ITK's cmake module's task to handle this, but it is 
not. any insights for this?

cheers,
viktor gal


More information about the Insight-users mailing list