[Insight-users] cmake couldn't find ITK-4.0

Juan Cardelino juan.cardelino at gmail.com
Mon May 23 15:58:18 EDT 2011


Hi Luis,
           Thanks for your answer. I think my previous mail was a
mess, so I will try to be clearer now. I had one installation of ITK 4
(an early version I think) in /usr/local/, the code was downloaded in
the folder /home/juan/juanc/soft/develop/ITK-dev/ITK and built in
/home/juan/juanc/soft/develop/ITK-dev/ITK-build. When I did a make
install, it will copy everything to /usr/local/include and
/usr/local/lib and after that my cmake based project used to found ITK
without problem.
As a side note, files where installed in
/usr/local/include/InsightToolikt-4.0 and
/usr/local/lib/InsightToolikt-4.0. I think the ITKConfig.cmake was in
/usr/local/lib/.

After some time from the first git clone, I've made a git pull on the
source directory (/home/juan/juanc/soft/develop/ITK-dev/ITK), rm -fr
on both /usr/local/include/InsightToolikt-4.0 and
/usr/local/lib/InsightToolikt-4.0 and after rebuilding it (cmake, make
,make install), I found two odd things:
*first: the libraries were refactored to from ITKCommon, ITK-Common-4.0.
*second: the ITKConfig.cmake was installed in /usr/local/lib/cmake/ITK-4.0

As you could see, not the ITK headers nor the libs are installed in
the cmake subfolder
>ls -lh /usr/local/lib/cmake/ITK-4.0/
total 64K
-rw-r--r-- 1 root root 4.2K 2011-05-11 10:56 ITKConfig.cmake
-rw-r--r-- 1 root root  309 2011-04-04 18:36 ITKConfigVersion.cmake
-rw-r--r-- 1 root root 1.7K 2011-04-04 18:35
itkImageIOFactoryRegisterManager.h.in
-rw-r--r-- 1 root root 2.6K 2011-04-25 10:36 ITKModuleAPI.cmake
-rw-r--r-- 1 root root 5.9K 2011-05-04 11:26 ITKTargets.cmake
-rw-r--r-- 1 root root  27K 2011-05-11 11:55 ITKTargets-noconfig.cmake
drwxr-xr-x 2 root root 4.0K 2011-05-04 11:35 Modules
-rw-r--r-- 1 root root 2.7K 2011-04-25 10:36 UseITK.cmake

So, short answer for you. No, I don't have two installations of ITK.
Maybe I have some leftovers from the first installation. I did this on
the 3 machines I work with the same result, so I'm sure I'm making a
systematic error.

Now, when I cmake on my project ITK isn't found, but when I set ITKDIR
to /usr/local/lib/cmake/ITK-4.0/ everything works perfect.
Any clues?
Thanks for your time.
Best,
         Juan



On Sat, May 21, 2011 at 4:31 PM, Luis Ibanez <luis.ibanez at kitware.com> wrote:
> Hi Juan,
>
> I'm not sure I understand your question.
>
> It looks like you have multiple installations of ITK,
> and you want to have CMake prefer one of them.
> Is that right ?
>
> From your email, it looks like you have one ITK
> installation in:
>
>                 /usr/local/lib/cmake/ITK-4.0
>
>
> Could you please clarify your question ?
>
>
>    Thanks
>
>
>         Luis
>
>
> --------------------------------------------------------------------
> On Mon, May 16, 2011 at 5:01 PM, Juan Cardelino
> <juan.cardelino at gmail.com> wrote:
>> Hello guys,
>> I have a silly question about cmake and ITK.
>> Usually, when I pulled the code and built ITK myself (even in version
>> 4.0), and tried to compile my code against it, cmake was able to find
>> the installed ITK. After some update of the code in GIT it is not able
>> to do it anymore. Now every project I try to compile using it, I have
>> to tell cmake to use the ITKConfig.cmake file, which was installed in
>> the build process in /usr/local/lib/cmake/ITK-4.0
>> Is there anything I can do to avoid this? I'm thinking about copying
>> the ITKConfig.cmake to some 'standard' place or something like that. I
>> thought when you perform 'make install' in the ITK build dir it was
>> automatically done, but I guess I was wrong.
>> I guess if I use /usr as the install prefix everythin will work, but I
>> don't really want to do that.
>> Thanks in advance.
>> Best regards,
>>                  Juan
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.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
>>
>


More information about the Insight-users mailing list