[Insight-users] Beginner CMake ITK_DIR Problem

Luis Ibanez luis.ibanez at kitware.com
Sun Aug 9 18:55:41 EDT 2009


Hi Maxima,

You should not move the binary build of ITK after compiling it.

What you should do, is to INSTALL it in that destination directory.


To clarify, we have three directories involved here:

   - (A) Source Code Directory
   - (B) Binary Directory
   - (C) Installation Directory

You download the source tree of ITK in directory (A).

You compile it in directory (B)

and then you can install it in directory (C).


After the installation, you can move (C) to another
directory, if you please, and that one will still work.


If you move (B) to another directory, it will not be
usable, because the CMake configuration has many
absolute directories expanded.


In order to install in the directory (C), you simply need
to rerun CMake and write the name of that directory (C)
in the CMake variable:

            CMAKE_INSTALL_PREFIX

Then, configure, generate and build.


Finally, you will do


   - From Linux:  make install
   - From Visual Studio: right click on the INSTALL project
   and select "Build".


   Regards,


         Luis


-------------------------------------
On Sun, Aug 9, 2009 at 6:39 PM, Maxima Mustermann <Maxima.M at gmx.de> wrote:

> Hey guys,
>
> I downloaded and built ITK to "D:/Development/ITK_Build"
> Now I moved the entire directory to another harddrive and I want to build a
> HelloWorld example now.
>
> The CMake Makefile is the following:
>
> PROJECT(HelloWorld)
> FIND_PACKAGE(ITK)
> IF(ITK_FOUND)
> INCLUDE(${ITK_USE_FILE})
> ELSE(ITK_FOUND)
> MESSAGE(FATAL_ERROR "ITK not found. Please set ITK_DIR.")
> ENDIF(ITK_FOUND)
> ADD_EXECUTABLE(HelloWorld HelloWorld.cxx )
> TARGET_LINK_LIBRARIES(HelloWorld ITKCommon)
>
> Now CMake says that it doesnt find "D:/Development/ITK_BUILD/UseITK.cmake"
> which obviously makes sense, because the directory doesnt exist anymore.
> But if I provide CMake with the correct location "E:/ITK_BUILD" there is no
> difference - CMake completely ignores the ITK_DIR I provide now and
> constantly uses the directory where ITK was initially built to.
> (-> the directory entries in the old CMake files from initial build are not
> updated to my new dir)
>
> How do I solve this problem?
> (provide a ITK_DIR in CMake and CMake uses this ITK_DIR in all other CMake
> files)
>
> Many thanks in advance
> --
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090809/2a8e9750/attachment.htm>


More information about the Insight-users mailing list