[Insight-users] About linking when using -lz

李健 rongx2 at live.cn
Tue Mar 24 11:21:39 EDT 2009


Dear all:

 

 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?

 

Thanks a lot.

 

 The following is my CMakeLists.txt:

 

 

cmake_minimum_required(VERSION 2.6)

PROJECT(testImage)

FIND_PACKAGE(ITK)
IF(ITK_FOUND)
  INCLUDE(${ITK_USE_FILE})
ELSE(ITK_FOUND)
  MESSAGE(FATAL_ERROR
          "ITK not found. Please set ITK_DIR.")
ENDIF(ITK_FOUND)

ADD_EXECUTABLE(testImage testImage.cpp)

find_library(IMAGE_LIBRARY NAMES image PATHS /home/zzz/lib)

TARGET_LINK_LIBRARIES(testImage ${ITK_LIBRARIES} ${IMAGE_LIBRARY})

 

 

_________________________________________________________________
MSN 表情魔法书,改变你的对话时代!
http://im.live.cn/emoticons/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20090324/27ec846a/attachment-0001.htm>


More information about the Insight-users mailing list