[Insight-users] CMakeLists question

Silviu D Minut minutsil at cse.msu.edu
Sat, 27 Mar 2004 16:00:57 -0500 (EST)


I'm trying to write my own CMakeLists.txt file for a simple project. In
all examples I saw, the user is required to enter the ITK_DIR:

# Find ITK.
FIND_PACKAGE(ITK)
IF(ITK_FOUND)
  INCLUDE(${ITK_USE_FILE})
ELSE(ITK_FOUND)
  MESSAGE(FATAL_ERROR
          "Cannot build without ITK.  Please set ITK_DIR.")
ENDIF(ITK_FOUND)

This is ok, but it's getting tiresome. I do have ITK installed, and it
won't change its location any time soon.  I don't mind cmake searching for
ITK (I assume the FIND also sets some variables too), but I don't want to
enter the path every time. How do I tell cmake beforehand what ITK_DIR
should be?

Thanks!