From: <ai...@us...> - 2009-04-17 22:31:34
|
Revision: 9814 http://plplot.svn.sourceforge.net/plplot/?rev=9814&view=rev Author: airwin Date: 2009-04-17 22:31:29 +0000 (Fri, 17 Apr 2009) Log Message: ----------- Add qt_gui bindings whose sole purpose is to configure a pkg-config plplot(d)-qt.pc file. The purpose of that file is to help build Qt applications that use the installed extqt "device" to access the PLplot API. Modified Paths: -------------- trunk/CMakeLists.txt Added Paths: ----------- trunk/bindings/qt_gui/ trunk/bindings/qt_gui/CMakeLists.txt Modified: trunk/CMakeLists.txt =================================================================== --- trunk/CMakeLists.txt 2009-04-17 16:58:19 UTC (rev 9813) +++ trunk/CMakeLists.txt 2009-04-17 22:31:29 UTC (rev 9814) @@ -129,6 +129,9 @@ add_subdirectory(data) add_subdirectory(bindings) add_subdirectory(drivers) +# Must be processed after drivers since depends on qt target created by +# drivers. +add_subdirectory(bindings/qt_gui) add_subdirectory(examples) add_subdirectory(utils) add_subdirectory(plplot_test) Added: trunk/bindings/qt_gui/CMakeLists.txt =================================================================== --- trunk/bindings/qt_gui/CMakeLists.txt (rev 0) +++ trunk/bindings/qt_gui/CMakeLists.txt 2009-04-17 22:31:29 UTC (rev 9814) @@ -0,0 +1,80 @@ +# bindings/qt/CMakeLists.txt +### Process this file with cmake to produce Makefile +### +# Copyright (C) 2006 Alan W. Irwin +# +# This file is part of PLplot. +# +# PLplot is free software; you can redistribute it and/or modify +# it under the terms of the GNU Library General Public License as published +# by the Free Software Foundation; version 2 of the License. +# +# PLplot is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with PLplot; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +if(PLD_extqt) + + # Transform "${qt_LINK_FLAGS}" to the + # standard pkg-config form. + pkg_config_link_flags( + libplplotqt${LIB_TAG}_LINK_FLAGS + "${qt_LINK_FLAGS}" + ) + + # Configure pkg-config *.pc file corresponding to the compile and link + # flags needed by a Qt GUI executable using extqt to gain access to PLplot. + if(PKG_CONFIG_EXECUTABLE) + if(LIB_TAG) + set(PC_PRECISION "double") + else(LIB_TAG) + set(PC_PRECISION "single") + endif(LIB_TAG) + # Each list element must consist of a colon-separated string with the + # following fields which are parsed out in the foreach loop below and + # used to configure the corresponding pkg-config *.pc file. + # BINDING - ENABLE_${BINDING} keeps track of whether a + # binding has been enabled (ON) or not (OFF). + # Also, ${BINDING} used to determine PC_FILE_SUFFIX + # which helps to determine name of configured + # *.pc file. + # PC_SHORT_NAME - Used in *.pc NAME: field + # PC_LONG_NAME - Used in *.pc Description: field + # PC_LIBRARY_NAME - Used in *.pc Libs: field + # Also used to determine PC_LINK_FLAGS and + # PC_COMPILE_FLAGS used in *.pc Libs: and Cflags: + # fields. + set(PC_DATA "qt:QT:QT4 bindings, :plplotqt${LIB_TAG}") + + string(REGEX REPLACE "^(.*):.*:.*:.*$" "\\1" BINDING ${PC_DATA}) + set(PC_FILE_SUFFIX "-${BINDING}") + set(PC_REQUIRES "plplot${LIB_TAG}") + string(REGEX REPLACE "^.*:(.*):.*:.*$" "\\1" PC_SHORT_NAME ${PC_DATA}) + string(REGEX REPLACE "^.*:.*:(.*):.*$" "\\1" PC_LONG_NAME ${PC_DATA}) + string(REGEX REPLACE "^.*:.*:.*:(.*)$" "\\1" PC_LIBRARY_NAME ${PC_DATA}) + if(ENABLE_DYNDRIVERS) + get_target_property(qt_LOCATION qt LOCATION) + get_filename_component(qt_LOCATION ${qt_LOCATION} NAME) + set(qt_LOCATION "\${drvdir}/${qt_LOCATION}") + #message("qt_LOCATION = ${qt_LOCATION}") + else(ENABLE_DYNDRIVERS) + set(qt_LOCATION) + endif(ENABLE_DYNDRIVERS) + set(PC_LINK_FLAGS "${qt_LOCATION} ${lib${PC_LIBRARY_NAME}_LINK_FLAGS}") + set(PC_COMPILE_FLAGS "${qt_COMPILE_FLAGS}") + set(PC_CONFIGURED_FILE + ${CMAKE_BINARY_DIR}/pkgcfg/plplot${LIB_TAG}${PC_FILE_SUFFIX}.pc + ) + configure_file( + ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.cmake + ${PC_CONFIGURED_FILE} + @ONLY + ) + install(FILES ${PC_CONFIGURED_FILE} DESTINATION ${PKG_CONFIG_DIR}) + endif(PKG_CONFIG_EXECUTABLE) +endif(PLD_extqt) Property changes on: trunk/bindings/qt_gui/CMakeLists.txt ___________________________________________________________________ Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |