Adding each of the libraries to the TARGET_LINK_LIBRARIES, instead of this LINK_LIBRARIES did not work. This is the part that confuses me the most. What LINK_LIBRARIES doing that TARGET_LINK_LIBRARIES is not?
==============Original message text=============== On Mon, 12 Nov 2007 12:45:13 EST "Brandon Van Every" wrote: On Nov 12, 2007 12:32 PM, <[EMAIL PROTECTED]> wrote: > > I've created a project (Farsight) that has this top-level CMakeLists file > (segment shown). The subdirs also have theirs. The cpp files in /seg > use VTK libraries. I have found that the project compiles using MS > Visual Studio, but not using g++. > > To get g++ to work I added this to the CMakeLists shown below: > LINK_LIBRARIES( > VTKCommon > VTKIO > VTKFiltering > ) > > I understand this to be an old command that is no longer necessary, and I > don't want to have it in this CMakeLists file because I don't need to > know what each module (subdir) requires for libraries. So why don't you just add VTKCommon VTKIO VTKFiltering to the appropriate TARGET_LINK_LIBRARIES commands? Cheers, Brandon Van Every > > ########################################################################## ###### > # Snippet of Top-Level CMakeLists.txt > ########################################################################## ###### > > SUBDIRS( wrap ) > > > # here we instruct CMake to build "Farsight" executable from all > # source files and place it in the "bin" folder > > ADD_EXECUTABLE( Farsight > ${FARSIGHT_SRCS} > ) > > # last thing we have to do is to tell CMake what libraries our executable > needs, > # luckily FIND_PACKAGE prepared QT_LIBRARIES variable for us: > TARGET_LINK_LIBRARIES( Farsight > ) > > > > ##################################################################### > The CMakeLists.txt in \wrap > ##################################################################### > SET( MY_WRAPPERS_SRCS > itkimage2qimage.cpp > qimage2itkimage.cpp > vtkLSMReader.cxx > ) > > SET( MY_WRAPPERS_HDRS > qimage2itkimage.h > vtkLSMReader.h > vtkBXDProcessingWin32Header.h > ) > > ADD_LIBRARY( fswrappers > ${MY_WRAPPERS_SRCS} > ${MY_WRAPPERS_HDRS} > ) > > TARGET_LINK_LIBRARIES( fswrappers ${QT_LIBRARIES} VTKCommon VTKFiltering ) > > > > > > > _______________________________________________ > CMake mailing list > CMake@cmake.org > http://www.cmake.org/mailman/listinfo/cmake> _______________________________________________ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake ===========End of original message text=========== _______________________________________________ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake