[Insight-developers] Forgetting to include ITK_USE_FILE in project CMakeLists.txt causes all file IO to fail?
Bradley Lowekamp
blowekamp at mail.nih.gov
Thu Nov 29 15:15:13 EST 2012
Kent,
I don't think a segfault is an intended behavior.
When is the tag you are using ITK from to test this?
I encountered this when I was working on the ObjectFactory 2 weeks ago, and I I fixed it for my case.
I actually did a find_package only for the IO module, and included the ${ITK_USE_FILE}, but no IO modules got registered. And a segfault happened.
May be only similar, yet different.
Brad
On Nov 29, 2012, at 3:07 PM, "Williams, Norman K" <norman-k-williams at uiowa.edu> wrote:
> I ran into this working through this bug:
> https://itk.icts.uiowa.edu/jira/browse/ITK-2859
>
> Turns out Micah Chambers was right; it segfaults. I finally figured out
> what the problem was: he does this:
>
> find_package(ITK REQUIRED)
> if(NOT ITK_FOUND)
> message(FATAL_ERROR "Cannot build without ITK. Please set ITK_DIR.")
> endif(NOT ITK_FOUND)
>
> without doing this:
>
>
> include(${ITK_USE_FILE})
>
> This is kind of baffling to me, but there's a lot of crazy computer
> science-y thingies going on under the covers with how the CMake
> configuration works.
>
> I will say this: It's kind of scary that the find_package succeeds, and
> the compilation and linking works without complaint, but without the
> UseITK.cmake the program craps itself if it tries to read or write a file.
>
> Is this an intended behavior? Is there a way that CMake could be forced
> to either do the work of UseITK.cmake, or complain if it isn't included?
>
>
>
> ________________________________
> Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you.
> ________________________________
> _______________________________________________
> 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://kitware.com/products/protraining.php
>
> 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-developers
More information about the Insight-developers
mailing list