<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>
<BR>
When I use itk in Linux, I need to link an executable to a non-itk library. It seems that I should use "-lz" in my link. But I don't know how to use this option in CMakeLists.txt. Can anyone tell me how to use "-lz" in CMakeLists.txt?<BR>
<BR>
Thanks a lot.<BR>
<BR>
The following is my CMakeLists.txt:<BR>
<BR>
<BR>
cmake_minimum_required(VERSION 2.6)<BR>
PROJECT(testImage)<BR>
FIND_PACKAGE(ITK)<BR>IF(ITK_FOUND)<BR> INCLUDE(${ITK_USE_FILE})<BR>ELSE(ITK_FOUND)<BR> MESSAGE(FATAL_ERROR<BR> "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>
<BR>
<BR><br /><hr />立刻下载 MSN 保护盾,保障 MSN 安全稳定! <a href='http://im.live.cn/safe/' target='_new'>现在就下载!</a></body>
</html>