[vtkusers] vtk4 & cmake & external libraries

Berk Geveci berk.geveci at kitware.com
Thu Mar 7 08:15:52 EST 2002


Here is an example:

MIL (Matrox Imaging Library):
In the main CMakeLists.txt (VTK/CMakeLists.txt):

IF (VTK_USE_HYBRID)
  IF (WIN32)
    OPTION(VTK_USE_MATROX_IMAGING "Use Matrox Imaging Library for video
input" OFF)
    IF (VTK_USE_MATROX_IMAGING)
      FIND_LIBRARY(MIL_LIBRARY MIL
        "C:/Program Files/Matrox Imaging/mil/library/winnt/msc/dll"
        "C:/Program Files/Matrox Imaging/mil/library/windows/msc/dll"
        )
      FIND_PATH(MIL_INCLUDE_PATH mil.h
        "C:/Program Files/Matrox Imaging/mil/include"
        )
    ENDIF (VTK_USE_MATROX_IMAGING)
  ENDIF (WIN32)

  SUBDIRS(Hybrid)
ENDIF (VTK_USE_HYBRID)

In Hybrid/CMakeLists.txt:
IF (WIN32)
  IF (VTK_USE_MATROX_IMAGING)
    LINK_LIBRARIES (${MIL_LIBRARY})
  ENDIF (VTK_USE_MATROX_IMAGING)
ENDIF (WIN32)

You will also have to add the LINK_LIBRARIES command to all
CMakeLists.txt files which create executables. This is specially
important when building with static libraries. You can find more
information about the CMake commands in the CMake documentation.

-Berk


On Thu, 2002-03-07 at 01:12, Alexandre Guimond wrote:
> Hi all.  I'm converthing my local code from vtk 3.2 to vtk 4.  That
> code uses an external lib (gsl) and I'm trying to figure out how what
> to add to which cmake files so that cmake asks for include & library
> paths to whoever is compiling, and how to add them to the final link
> command for my library.  does anyone have any info or example for
> this?
> -- 
> Alexandre Guimond, Ph.D. <guimond at bwh.harvard.edu> Phone: 617.278.0800
> Instructor in Radiology, Harvard Medical School    Fax  : 617.264.5154
> Brigham and Women's Hospital, Department of Radiology
> Center for Neurological Imaging, 221 Longwood Av, Boston, MA 02115
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers





More information about the vtkusers mailing list