[Insight-users] Re: Help learning ITK : Order matters in command lines of a CMakeLists.txt file

Luis Ibanez luis.ibanez at kitware.com
Wed Sep 28 12:00:17 EDT 2005


Hi Hong,

CMake is now being made more procedural, so the order in which
you put the CMake commands in a CMakeLists.txt file matters more
now.

What the error message is telling you is that you have the order

    TARGET_LINK_LIBRARIES( FooTarget  FooLibrary )
    ADD_LIBRARY( FooLibrary )

So.. in the first line you are adding a dependency to the FooLibrary
that doesn't exist yet.  CMake is asking you to swap the order of the
lines to be


    ADD_LIBRARY( FooLibrary )
    TARGET_LINK_LIBRARIES( FooTarget  FooLibrary )



As you migrate to CMake 2.2 you will see more and more of these
ordering issues.



    Regards,


      Luis


-------------------

Xiang, Hong wrote:
> Thanks for a quick response, Ashish. 
>  
> By reading your response, I realized that I probably should first configure and
> build ITK first before compiling the HelloWorld project.
>  
> So now I first tried to configure ITK (following Luis's powerpoint instruction
> on "Getting Started with ITK" in the doc area on ITK web site), I saw an error
> message:
>  
> "Library ITKBasicFilters is defined using ADD_LIBRARY after the library is used
> using TARGET_LINK_LIBRARIES for the target ITKFEM. This breaks Cmake's
> dependency handing, please fix the CmakeLists.txt file."
> 
>  
> 
> Any tip on how to get rid of this error? fixing the CmakeLists.txt, which one in
> which directory?
> 
>  
> 
> Thanks!
> 
> Hong
> 
>  
> 
>  
> 
>  
>  
> 
> ________________________________
> 
> From: Ashish Poddar [mailto:ahpoddar at gmail.com]
> Sent: Tue 9/27/2005 2:32 PM
> To: Xiang, Hong
> Subject: Re: Help learning ITK
> 
> 
> Hi Xiang,
> 
> I will be glad to help u. Though I am sure you must be getting lot of help from
> the email list as well.
> 
> This error message you are getting when compiling ITK library or when compiling
> a project using ITK library? 
> 
> in either case my guess is it has to do something with the CMAKE settings.
> 
> if you can give more details, I might help you further,
> with regards,
> Ashish.
> 
> 
> On 9/27/05, Xiang, Hong <HXIANG at lroc.arvard.edu> wrote: 
> 
> 	Hello Ashish,
> 	
> 	I saw from the email list that you are using ITK under MS Windows. I
> just
> 	started learning to use the package and maybe you could share about your
> initial
> 	learning with me.
> 	
> 	If you see an error message like "Can not build without ITK, please set 
> 	ITK_DIR", where should I do this, I mean set ITK_DIR?
> 	
> 	Thanks for the help in advance.
> 	
> 	Hong
> 	
> 
> 
> 
> 



More information about the Insight-users mailing list