[CMake] CMake 2.8.4 -- FindITK.cmake fails to find ITK even when ITK_DIR is properly set.

kent williams nkwmailinglists at gmail.com
Tue Mar 8 11:01:02 EST 2011


Thanks for getting back to me on this.  After my initial post I tried
to come up with some 'cut-down' examples, and the simple cases work.
I'll keep trying to get a version that exhibits this failure.

This is kind of a worst case for debugging.  I have a top level
CMakeLists.txt file that builds ITK. Then, it builds several projects
as ExternalProjects, passing in ITK_DIR in CMAKE_ARGS.  It's in that
secondary configure -- the one that make does as part of the build --
where I get a failure.

On Tue, Mar 8, 2011 at 7:17 AM, Brad King <brad.king at kitware.com> wrote:
> On 03/07/2011 03:59 PM, kent williams wrote:
>> Looking at the difference between FindITK.cmake in 2.8.3 and 2.8.4 it
>> looks like someone replaced trusting the ITK_DIR variable and using it
>> directly if defined, with
>>
>> FIND_PACKAGE(ITK QUIET NO_MODULE
>> NAMES ITK InsightToolkit CONFIGS ITKConfig.cmake)
>>
>> Which doesn't work -- it appears to ignore ITK_DIR and doggedly insist
>> that it can't find ITK.
>
> The find_package command will use ITK_DIR without searching at all if it is set.
> I can't reproduce your problem.  CMake 2.8.4 finds ITK for me in all the cases
> it used to find it plus more.  Setting ITK_DIR hands it the answer and it works.
> Please send a complete sample CMakeLists.txt that shows this problem along with
> a listing of the contents of ${ITK_DIR} on your disk.
>
> Thanks,
> -Brad
>


More information about the CMake mailing list