From: <ai...@us...> - 2008-01-26 01:52:07
|
Revision: 8176 http://plplot.svn.sourceforge.net/plplot/?rev=8176&view=rev Author: airwin Date: 2008-01-25 17:52:13 -0800 (Fri, 25 Jan 2008) Log Message: ----------- Use new cmake_link_flags macro to put cairo_LINK_FLAGS in best form (full pathnames for libraries) for internal cmake use. Implement cairo_RPATH. (These changes mean that a pango/cairo stack installed in a non-standard location can be used for PLplot.) Style changes. Modified Paths: -------------- trunk/cmake/modules/cairo.cmake Modified: trunk/cmake/modules/cairo.cmake =================================================================== --- trunk/cmake/modules/cairo.cmake 2008-01-26 01:40:13 UTC (rev 8175) +++ trunk/cmake/modules/cairo.cmake 2008-01-26 01:52:13 UTC (rev 8176) @@ -1,4 +1,4 @@ -# cmake/modules/psttf.cmake +# cmake/modules/cairo.cmake # # Copyright (C) 2007 Hazen Babcock # @@ -17,17 +17,27 @@ # along with the file PLplot; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -# Configuration for the psttf device driver (supporting the psttf and -# psttfc devices). +# Configuration for the cairo device driver (supporting the memcairo, +# pdfcairo, pngcairo, pscairo, svgcairo, memcairo, and xcairo devices). # # The following variables are set / modified # -# PLD_xcairo - ON means the xcairo device is enabled. -# cairo_COMPILE_FLAGS - Blank-delimited COMPILE_FLAGS required to -# compile cairo device drivers. -# cairo_LINK_FLAGS - LINK_FLAGS (string) for dynamic cairo device drivers. -# DRIVERS_LINK_FLAGS - list of device LINK_FLAGS and TARGETS for case -# when ENABLE_DYNDRIVERS OFF. +# PLD_memcairo - ON means the memcairo device is enabled. +# PLD_pdfcairo - ON means the pdfcairo device is enabled. +# PLD_pngcairo - ON means the pngcairo device is enabled. +# PLD_pscairo - ON means the pscairo device is enabled. +# PLD_svgcairo - ON means the svgcairo device is enabled. +# PLD_xcairo - ON means the xcairo device is enabled. +# cairo_COMPILE_FLAGS - Blank-delimited COMPILE_FLAGS required to +# compile cairo device drivers. +# cairo_LINK_FLAGS - list of full path names of libraries and +# linker flags for dynamic cairo device driver. +# cairo_RPATH - RPATH directory list for cairo device driver. +# current assumption is the list only has one +# element corresponding to the pkg-config libdir +# variable for pangocairo. +# DRIVERS_LINK_FLAGS - list of device LINK_FLAGS for case +# when ENABLE_DYNDRIVERS OFF. # Include file searches use FindPath. To add extra search directories # set the environment variable CMAKE_INCLUDE_PATH. @@ -36,45 +46,70 @@ # See cmake documentation for further details. # Look for cairo headers and libraries with pkg-config -if(PLD_xcairo OR PLD_pdfcairo OR PLD_pscairo OR PLD_svgcairo OR PLD_pngcairo OR PLD_memcairo) +if( + PLD_memcairo +OR PLD_pdfcairo +OR PLD_pngcairo +OR PLD_pscairo +OR PLD_svgcairo +OR PLD_xcairo +) if(NOT PKG_CONFIG_EXECUTABLE) message(STATUS "WARNING: pkg-config not found. Setting cairo drivers to OFF." ) - set(PLD_xcairo OFF CACHE BOOL "Enable xcairo device" FORCE) + set(PLD_memcairo OFF CACHE BOOL "Enable memcairo device" FORCE) set(PLD_pdfcairo OFF CACHE BOOL "Enable pdfcairo device" FORCE) + set(PLD_pngcairo OFF CACHE BOOL "Enable pngcairo device" FORCE) set(PLD_pscairo OFF CACHE BOOL "Enable pscairo device" FORCE) set(PLD_svgcairo OFF CACHE BOOL "Enable svgcairo device" FORCE) - set(PLD_pngcairo OFF CACHE BOOL "Enable pngcairo device" FORCE) - set(PLD_memcairo OFF CACHE BOOL "Enable memcairo device" FORCE) + set(PLD_xcairo OFF CACHE BOOL "Enable xcairo device" FORCE) endif(NOT PKG_CONFIG_EXECUTABLE) -endif(PLD_xcairo OR PLD_pdfcairo OR PLD_pscairo OR PLD_svgcairo OR PLD_pngcairo OR PLD_memcairo) +endif( + PLD_memcairo +OR PLD_pdfcairo +OR PLD_pngcairo +OR PLD_pscairo +OR PLD_svgcairo +OR PLD_xcairo +) -if(PLD_xcairo OR PLD_pdfcairo OR PLD_pscairo OR PLD_svgcairo OR PLD_pngcairo OR PLD_memcairo) - pkg_check_pkgconfig("pangocairo;pango;cairo" includedir libdir linkflags cflags _CAIRO) +if( + PLD_memcairo +OR PLD_pdfcairo +OR PLD_pngcairo +OR PLD_pscairo +OR PLD_svgcairo +OR PLD_xcairo +) + pkg_check_pkgconfig( + "pangocairo" + includedir + cairo_RPATH + linkflags + cflags + _CAIRO + ) if(linkflags) # Blank-delimited required. if(PLD_xcairo AND X11_COMPILE_FLAGS) string(REGEX REPLACE ";" " " cairo_COMPILE_FLAGS "${cflags} ${X11_COMPILE_FLAGS}" ) - set(cairo_LINK_FLAGS "${linkflags} -L${X11_LIBRARY_DIR} ${X11_LIBRARIES}") + cmake_link_flags(cairo_LINK_FLAGS "${linkflags} -L${X11_LIBRARY_DIR} ${X11_LIBRARIES}") else(PLD_xcairo AND X11_COMPILE_FLAGS) - string(REGEX REPLACE ";" " " cairo_COMPILE_FLAGS "${cflags}") - set(cairo_LINK_FLAGS "${linkflags}") message(STATUS "WARNING: X windows not found. Setting xcairo driver to OFF." ) set(PLD_xcairo OFF CACHE BOOL "Enable xcairo device" FORCE) + # now deal with remaining cairo devices. + string(REGEX REPLACE ";" " " cairo_COMPILE_FLAGS "${cflags}") + cmake_link_flags(cairo_LINK_FLAGS "${linkflags}") endif(PLD_xcairo AND X11_COMPILE_FLAGS) # message("cairo_COMPILE_FLAGS = ${cairo_COMPILE_FLAGS}") - set(DRIVERS_LINK_FLAGS - ${DRIVERS_LINK_FLAGS} - ${cairo_LINK_FLAGS} - ${cairo_TARGETS} - ) + list(APPEND DRIVERS_LINK_FLAGS ${cairo_LINK_FLAGS}) else(linkflags) #message("includedir = ${includedir}") #message("libdir = ${libdir}") @@ -85,11 +120,18 @@ " Setting cairo drivers to OFF. Please install all of these packages\n" " and/or set the environment variable PKG_CONFIG_PATH appropriately." ) - set(PLD_xcairo OFF CACHE BOOL "Enable xcairo device" FORCE) - set(PLD_pdfcairo OFF CACHE BOOL "Enable pdfcairo device" FORCE) + set(PLD_memcairo OFF CACHE BOOL "Enable memcairo device" FORCE) + set(PLD_pdfcairo OFF CACHE BOOL "Enable pdfcairo device" FORCE) + set(PLD_pngcairo OFF CACHE BOOL "Enable pngcairo device" FORCE) set(PLD_pscairo OFF CACHE BOOL "Enable pscairo device" FORCE) set(PLD_svgcairo OFF CACHE BOOL "Enable svgcairo device" FORCE) - set(PLD_pngcairo OFF CACHE BOOL "Enable pngcairo device" FORCE) - set(PLD_memcairo OFF CACHE BOOL "Enable memcairo device" FORCE) + set(PLD_xcairo OFF CACHE BOOL "Enable xcairo device" FORCE) endif(linkflags) -endif(PLD_xcairo OR PLD_pdfcairo OR PLD_pscairo OR PLD_svgcairo OR PLD_pngcairo OR PLD_memcairo) +endif( + PLD_memcairo +OR PLD_pdfcairo +OR PLD_pngcairo +OR PLD_pscairo +OR PLD_svgcairo +OR PLD_xcairo +) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |