Hi,

we are using cmake for building plplot, but what about if you want to use plplot for your own programs using cmake? Sure, you use FindPLplot.cmake which has yet to be written.

I attach a first version which should work for all platforms, but needs to be changed to use pkg-config for Linux and OSX. Also I didn't include all libraries (plplot_canvas, etc). I think we should somehow put it in cvs and make it available to the cmake team (hopefully they include it).

Where should I put it? cmake/external wouldn't be the right place and cmake/modules would also be wrong. Who could help me (Alan :) to make the script perfect?

Thanks,
Werner

--
Dipl. Ing. Werner Smekal
Institut fuer Allgemeine Physik
Technische Universitaet Wien
Wiedner Hauptstr 8-10
A-1040 Wien
Austria

email: [EMAIL PROTECTED]
web:   http://www.iap.tuwien.ac.at/~smekal
phone: +43-(0)1-58801-13463 (office)
       +43-(0)1-58801-13469 (laboratory)
fax:   +43-(0)1-58801-13499
# Find PLplot header and library.

# This module defines the following uncached variables:
#  PLplot_FOUND, if false, do not try to use PLplot.
#  PLplot_INCLUDE_DIRS, where to find plplot.h.
#  PLplot_LIBRARIES, the libraries to link against to use PLplot
#  PLplot_LIBRARY_DIRS, the directory where the PLplot library is found.

FIND_PATH(
  PLplot_INCLUDE_DIR
  plplot.h 
  /usr/local/include 
  /usr/include
)

IF( PLplot_INCLUDE_DIR )
  find_library( PLplot_LIBRARY
    NAMES plplotd
    PATHS /usr/local/lib /usr/lib
  )
  if(PLplot_LIBRARY)
    set( PLplot_LIBRARY_DIR "" )
    get_filename_component(PLplot_LIBRARY_DIRS ${PLplot_LIBRARY} PATH)
    # Set uncached variables as per standard.
    set(PLplot_FOUND ON)
    set(PLplot_INCLUDE_DIRS ${PLplot_INCLUDE_DIR})
    set(PLplot_LIBRARIES ${PLplot_LIBRARY})
  endif(PLplot_LIBRARY)
  
  # find cxx bindings
  find_library( PLplot_cxx_LIBRARY
    NAMES plplotcxxd
    PATHS /usr/local/lib /usr/lib
  )
  if( PLplot_cxx_LIBRARY )
    set( PLplot_LIBRARIES ${PLplot_LIBRARIES} ${PLplot_cxx_LIBRARY} )
  endif( PLplot_cxx_LIBRARY )
  
  # find f77 bindings
  find_library( PLplot_f77_LIBRARY
    NAMES plplotf77d
    PATHS /usr/local/lib /usr/lib
  )
  if( PLplot_f77_LIBRARY )
    set( PLplot_LIBRARIES ${PLplot_LIBRARIES} ${PLplot_f77_LIBRARY} )
  endif( PLplot_f77_LIBRARY )

  # find f90 bindings
  find_library( PLplot_f90_LIBRARY
    NAMES plplotf90d
    PATHS /usr/local/lib /usr/lib
  )
  if( PLplot_f90_LIBRARY )
    set( PLplot_LIBRARIES ${PLplot_LIBRARIES} ${PLplot_f90_LIBRARY} )
  endif( PLplot_f90_LIBRARY )

  # find wxwidgets bindings
  find_library( PLplot_wxwidgets_LIBRARY
    NAMES plplotwxwidgetsd
    PATHS /usr/local/lib /usr/lib
  )
  if( PLplot_wxwidgets_LIBRARY )
    set( PLplot_LIBRARIES ${PLplot_LIBRARIES} ${PLplot_wxwidgets_LIBRARY} )
  endif( PLplot_wxwidgets_LIBRARY )
endif(PLplot_INCLUDE_DIR)
            
if(PLplot_FOUND)
  if(NOT PLplot_FIND_QUIETLY)
    message(STATUS "FindPLplot: Found both PLplot headers and library")
  endif(NOT PLplot_FIND_QUIETLY)
else(PLplot_FOUND)
  if(PLplot_FIND_REQUIRED)
    message(FATAL_ERROR "FindPLplot: Could not find PLplot headers or library")
  endif(PLplot_FIND_REQUIRED)
endif(PLplot_FOUND)
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to