[Insight-developers] cmake

Stephen R. Aylward aylward@unc.edu
Wed, 25 Sep 2002 10:58:20 -0400


Perhaps adding the USE_ITK_FILE to the FindITK.cmake is a good idea.

Right now (for me :) ), I am having to specify
LINK_DIRECTORIES (
${ITK_LIBRARY_PATH}
)
as well as the LINK_LIBRARIES (I haven't switched to using the TARGET 
version of the command - I will).

I understand the right thing to do is to have the user specify the link 
libraries (it sounds like CMake is doing a great job on dependencies - I 
didn't realize that).  This is probably a really stupid question - there 
are occasional (frequent?) gaping holes in what I know and this appears 
to be one of them, but is it that bad to link with libraries that are 
not used - I thought modern linkers only take the object code it needs 
from a linked library, so if a library's functions aren't used, it 
doesn't add to the size of the resulting executable.

Stephen

Bill Hoffman wrote:
> It should add all the include paths and library paths, but not the libraries.
> The users should specifiy only the libraries directly used by the application.
> CMake now knows which libraries need each other.  So, the above should work with
> one added line:
> 
> TARGET_LINK_LIBRARIES(MyProject ITKNumerics ITKIO)
> 
> (Assuming the project used ITKNumerics and ITKIO directly.   Cmake will
> add all the other libraries used by ITKNumerics and ITKIO.)  We don't want
> to force folks to link in libraries they are not using.
> 
> If the include paths and library path is not being added, I will fix it.
> 
> -Bill
> 
> 
> At 10:14 AM 9/25/2002 -0400, Stephen R. Aylward wrote:
> 
> 
>>Hi,
>>
>>If someone does a FindITK.cmake, shouldn't we assume that they want to include ITK paths and libraries?
>>
>>There are arguments against this, but perhaps it would be nice if the following CMakeLists.txt file was sufficient to compile an ITK program out of source...
>>
>>PROJECT(MyProject)
>>
>>INCLUDE (${CMAKE_ROOT}/Modules/FindITK.cmake)
>>
>>SET ( MYPROJECT_SRCS
>>main.cxx
>>)
>>
>>ADD_EXECUTABLE( MyProject MYPROJECT_SRCS )
>>
> 
> 
> 


-- 
===============================================
Dr. Stephen R. Aylward
Assistant Professor of Radiology
Adjunct Assistant Professor of Computer Science
http://caddlab.rad.unc.edu
aylward@unc.edu
(919) 966-9695