<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Dear all:<BR>
&nbsp;<BR>
&nbsp;When I use itk in Linux, I need to&nbsp;link an executable to&nbsp;a non-itk&nbsp;library. It seems that I&nbsp;should use&nbsp;"-lz" in my link. But I don't know how to use this option in CMakeLists.txt.&nbsp; Can anyone tell me how to use "-lz" in CMakeLists.txt?<BR>
&nbsp;<BR>
Thanks a lot.<BR>
&nbsp;<BR>
&nbsp;The following&nbsp;is my CMakeLists.txt:<BR>
&nbsp;<BR>
&nbsp;<BR>
cmake_minimum_required(VERSION 2.6)<BR>
PROJECT(testImage)<BR>
FIND_PACKAGE(ITK)<BR>IF(ITK_FOUND)<BR>&nbsp; INCLUDE(${ITK_USE_FILE})<BR>ELSE(ITK_FOUND)<BR>&nbsp; MESSAGE(FATAL_ERROR<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "ITK not found. Please set ITK_DIR.")<BR>ENDIF(ITK_FOUND)<BR>
ADD_EXECUTABLE(testImage testImage.cpp)<BR>
find_library(IMAGE_LIBRARY NAMES image PATHS /home/zzz/lib)<BR>
TARGET_LINK_LIBRARIES(testImage ${ITK_LIBRARIES} ${IMAGE_LIBRARY})<BR>
&nbsp;<BR>
&nbsp;<BR><br /><hr />立刻下载 MSN 保护盾,保障 MSN 安全稳定! <a href='http://im.live.cn/safe/' target='_new'>现在就下载!</a></body>
</html>