[Insight-users] trouble setting ITK_DIR : cannot find itkImage.h

Pratik Talole pratiktalole at gmail.com
Sun Jun 10 05:28:11 EDT 2012


Hi,

I am trying to build my ITK project in a static library and link it to an
existing console application. I used CMake to configure my ITK project. Here
is my CMakeLists file : 

# This is the root ITK CMakeLists file.
cmake_minimum_required(VERSION 2.4)
if(COMMAND CMAKE_POLICY)
  cmake_policy(SET CMP0003 NEW)
endif(COMMAND CMAKE_POLICY)
SET (ITK_DIR   F:\ITK_jun1\bin)
# This project is designed to be built outside the Insight source tree.
project(HelloWorld)
# Find ITK.
find_package(ITK REQUIRED)
include(${ITK_USE_FILE})
add_executable(HelloWorld HelloWorld.cxx )
target_link_libraries(HelloWorld ${ITK_LIBRARIES})
ADD_LIBRARY( MyLibraryName STATIC   HelloWorld.cxx  )
TARGET_LINK_LIBRARIES( MyLibraryName  ITKCommon )

However, when I link my console application to the ITK project, I get error
messages such as "itkImage.h not found". It cannot find any of the ITK
header files.

I have read that ITK_DIR is responsible for inclusion of headers from ITK
source tree. In my case, I have set ITK_DIR to the root bin directory from
CMake GUI. I have also added ITK_DIR as an environment variable and also to
the CmakeLists file. 

Can you please help me figure out what's going wrong?

Also, I noticed something unusual. When I was creating a new HelloWorld
project (from examples\installation), I got an error on CMake GUI saying
that ITK_DIR was not set. I had to manually set it to ITK root bin directory
in order to get configure to work.



--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/trouble-setting-ITK-DIR-cannot-find-itkImage-h-tp7580227.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.


More information about the Insight-users mailing list