[Insight-users] ITK_LIBRARY_DIRS not being brought in by CMake

Parag Chandra pchandra@radonc.unc.edu
Tue, 12 Nov 2002 17:34:37 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_0071_01C28A71.C5C450B0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi all,

I've been using CMake/ITK for a while now, and in previous projects, =
I've manually put in the include directories, link directories, =
libraries, etc. into my CMakeLists files. I recently started a new =
project and pulled down the official 1.0 release of Insight and CMake =
1.4 patch 6 for Windows, and in some examples I noticed that the =
preferred way to utilize ITK from an external project is now much =
simpler. Following the example, my CMakeLists file looks like this:

PROJECT (aks)

INCLUDE (${CMAKE_ROOT}/Modules/FindITK.cmake)
IF (USE_ITK_FILE)
    INCLUDE (${USE_ITK_FILE})
ENDIF (USE_ITK_FILE)

ADD_EXECUTABLE (aksTestPNGIO aksTestPNGIO.cxx)
TARGET_LINK_LIBRARIES (aksTestPNGIO ${ITK_LIBRARIES})

I use CMake to create the .dsw and .dsp files for VS6 in an =
out-of-source build directory. The project compiles successfully, but =
during linking, it's unable to find any of the ITK libraries because =
there are no 'Additional library path's defined under the Project =
Settings in Visual Studio. This is strange to me because the libraries =
defined by ITK_LIBRARIES, the include directories defined by =
ITK_INCLUDE_DIRS, and the definitions in ITK_DEFINITIONS are all in the =
project in the appropriate places; just ITK_LIBRARY_DIRS seems to be =
missing. Even explicitly adding the directive LINK_DIRECTORIES =
(${ITK_LIBRARY_DIRS}) in CMakeLists.txt does not bring in the library =
paths. I'm positive CMake is getting the other entries correctly from =
<my ITK build directory>/ITKConfig.cmake, because modifying =
ITK_INCLUDE_DIRS in that file and re-running CMake causes the changes to =
appear in the .dsp file. Furthermore, ITK_LIBRARY_DIRS is correctly set =
in ITKConfig.cmake, it's just not getting written to the .dsp file by =
CMake. Does anyone have an idea what's going on here? Thanks.

-Parag Chandra

------=_NextPart_000_0071_01C28A71.C5C450B0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi all,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I've been using CMake/ITK for a while =
now, and in=20
previous projects, I've manually put in the include directories, link=20
directories, libraries, etc. into my CMakeLists files. I recently =
started a new=20
project and pulled down the official 1.0 release of Insight and CMake =
1.4 patch=20
6 for Windows, and in some examples I noticed that the preferred way to =
utilize=20
ITK from an external project is now much simpler. Following the example, =
my=20
CMakeLists file looks like this:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>PROJECT (aks)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>INCLUDE =
(${CMAKE_ROOT}/Modules/FindITK.cmake)<BR>IF=20
(USE_ITK_FILE)<BR>&nbsp;&nbsp;&nbsp; INCLUDE (${USE_ITK_FILE})<BR>ENDIF=20
(USE_ITK_FILE)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>ADD_EXECUTABLE (aksTestPNGIO=20
aksTestPNGIO.cxx)<BR>TARGET_LINK_LIBRARIES (aksTestPNGIO=20
${ITK_LIBRARIES})</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I use CMake to create the .dsw and .dsp =
files for=20
VS6 in an out-of-source build directory. The project compiles =
successfully, but=20
during linking, it's unable to find any of the ITK libraries because =
there are=20
no 'Additional library path's defined under the Project Settings in =
Visual=20
Studio. This is strange to me because the libraries defined by =
ITK_LIBRARIES,=20
the include directories defined by ITK_INCLUDE_DIRS, and the definitions =
in=20
ITK_DEFINITIONS are all in the project in the appropriate places; just=20
ITK_LIBRARY_DIRS seems to be missing. Even explicitly adding the =
directive=20
LINK_DIRECTORIES (${ITK_LIBRARY_DIRS}) in&nbsp;CMakeLists.txt does not =
bring in=20
the library paths. I'm positive CMake is getting the other entries =
correctly=20
from &lt;my ITK build directory&gt;/ITKConfig.cmake, because modifying=20
ITK_INCLUDE_DIRS in that file and&nbsp;re-running CMake causes the =
changes to=20
appear in the .dsp file. Furthermore, ITK_LIBRARY_DIRS is correctly set =
in=20
ITKConfig.cmake, it's just not getting written to the .dsp file by =
CMake. Does=20
anyone have an idea what's going on here? Thanks.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>-Parag Chandra</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_0071_01C28A71.C5C450B0--