[Insight-developers] Can't find itkpng.lib; don't need it anyway.
Luis Ibanez
luis.ibanez@kitware.com
Wed, 18 Sep 2002 13:24:30 -0400
Hi Mark,
itkpng.lib is added to the link list because the ImageIOFactories
have several file formats registered by default.
The defaults are: { PNG, MetaImage, Dicom, VTK }
As long as you use any IO in your program, the libraries
associated with these default formats will enter into the
dependencies.
The need for the LINK_DIRECTORIES will be solved by the
current ongoing process of placing all libraries and
executables in a single common directory.
You shouldn't need to add "Debug" to the paths.
The CMakeLists.txt files are independent of the build
configuration.
Luis
===========================================================
Mark Foskey wrote:
> When I try to compile using the .dsw file from the CMakeLists.txt file
> appended below, I get the message:
>
> LINK : fatal error LNK1181: cannot open input file "itkpng.lib"
>
> This is puzzling since I'm not using itkpng.lib.
>
> I assume that a workaround for the problem is to add the appropriate
> directory under LINK_DIRECTORIES, but I don't think users should need to
> do that explicitly, at least if they're not explicitly requesting
> itkpng.lib.
>
> Also, I had to add the "Debug" at the end of
> ${ITK_BINARY_DIR}/Code/IO/Debug to avoid an error, and that doesn't seem
> right eiter.
>
> Are these the right behaviors?
>
> The CMakeLists.txt file:
>
> PROJECT(DicomMod)
>
> # Find ITK
> INCLUDE (${CMAKE_ROOT}/Modules/FindITK.cmake)
> IF (USE_ITK_FILE)
> INCLUDE (${USE_ITK_FILE})
> ENDIF (USE_ITK_FILE)
>
> #indicate directores and libraries
>
> INCLUDE_DIRECTORIES(
> ${ITK_SOURCE_DIR}/Code/IO
> )
>
> LINK_DIRECTORIES(
> ${ITK_BINARY_DIR}/Code/IO/Debug
> )
>
> LINK_LIBRARIES (
> ITKIO
> )
>
> #specify executables
> ADD_EXECUTABLE(itkDicomImageIOTest itkDicomImageIOTest)
>
>