[CMake] Linking Libraries
abboti at rpi.edu
abboti at rpi.edu
Tue Nov 13 08:00:37 EST 2007
I'll also add that the project compiles using MS Visual C++ with the
LINK_LIBRARIES removed (no reference to these VTKLibraries anywhere in
the top-level CMakeLists.
==============Original message text===============
On Tue, 13 Nov 2007 7:17:50 EST abboti at rpi.edu wrote:
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, <abboti at rpi.edu> 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 at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake>_______________________________________________
CMake mailing list
CMake at cmake.org
http://www.cmake.org/mailman/listinfo/cmake===========End of original message text===========
_______________________________________________
CMake mailing list
CMake at cmake.org
http://www.cmake.org/mailman/listinfo/cmake
===========End of original message text===========
More information about the CMake
mailing list