[Insight-users] CMAKE error when I add my own library

Irene Gonzálvez irenegonzalvezg at gmail.com
Mon Mar 31 13:23:26 EDT 2008


Dear insight-users,

I have been modifying one of the libraries of ITK for including it in my
project, but I have found a problem because the CMake doesn't create the
file .lib, so I cannot build the project using the Visual Studio 2005
without any error. In the souce project of my folder, I have a subfolder
called: Library which contains the .txx and .h files.


PROJECT(myProject)

FIND_PACKAGE(ITK)
IF(ITK_FOUND)
  INCLUDE(${USE_ITK_FILE})
ENDIF(ITK_FOUND)

INCLUDE_DIRECTORIES(${myProject_SOURCE_DIR}/Library)

LINK_DIRECTORIES (${myProject_BINARY_DIR}/Library)

ADD_LIBRARY (myfunctions
Library/itkBinaryBallStructuringElement_modified.txx)

SET_TARGET_PROPERTIES(myfunctions PROPERTIES LINKER_LANGUAGE C)
//without the previous line I obtained the following error in the CMake:
CMake cannot determine linker language for target

ADD_EXECUTABLE (myProject myProject.cxx)

TARGET_LINK_LIBRARIES (myProject ITKCommon ITKIO myfunctions )

Thanks in advance for your help
Best regards
Irene
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20080331/6a193422/attachment.htm>


More information about the Insight-users mailing list