From: <ai...@us...> - 2009-05-23 20:22:32
|
Revision: 9994 http://plplot.svn.sourceforge.net/plplot/?rev=9994&view=rev Author: airwin Date: 2009-05-23 20:22:17 +0000 (Sat, 23 May 2009) Log Message: ----------- Add test of python examples to new CMake-based build system for the installed examples tree. Modified Paths: -------------- trunk/examples/CMakeLists.txt_installed_examples trunk/examples/plplot_configure.cmake_installed_examples.in trunk/examples/python/CMakeLists.txt Added Paths: ----------- trunk/examples/python/CMakeLists.txt_installed_examples_python Modified: trunk/examples/CMakeLists.txt_installed_examples =================================================================== --- trunk/examples/CMakeLists.txt_installed_examples 2009-05-23 19:53:06 UTC (rev 9993) +++ trunk/examples/CMakeLists.txt_installed_examples 2009-05-23 20:22:17 UTC (rev 9994) @@ -85,6 +85,12 @@ list(APPEND language_info_LIST perl:pdl) endif(ENABLE_pdl) +if(ENABLE_python) + add_subdirectory(python) + get_property(targets_examples_python GLOBAL PROPERTY TARGETS_examples_python) + list(APPEND language_info_LIST python:p) +endif(ENABLE_python) + # Octave not configured yet so the following stanza ignored for now. if(ENABLE_octave) add_subdirectory(octave) Modified: trunk/examples/plplot_configure.cmake_installed_examples.in =================================================================== --- trunk/examples/plplot_configure.cmake_installed_examples.in 2009-05-23 19:53:06 UTC (rev 9993) +++ trunk/examples/plplot_configure.cmake_installed_examples.in 2009-05-23 20:22:17 UTC (rev 9994) @@ -14,6 +14,7 @@ set(ENABLE_lua @ENABLE_lua@) set(ENABLE_ocaml @ENABLE_ocaml@) set(ENABLE_pdl @ENABLE_pdl@) +set(ENABLE_python @ENABLE_python@) # Always enable C language. enable_language(C) @@ -52,3 +53,8 @@ set(CMAKE_INSTALL_LIBDIR @CMAKE_INSTALL_LIBDIR@) set(OCAML_INSTALL_DIR @OCAML_INSTALL_DIR@) endif(ENABLE_ocaml) + +if(ENABLE_python) + set(ENABLE_pygcw @ENABLE_pygcw@) +endif(ENABLE_python) + Modified: trunk/examples/python/CMakeLists.txt =================================================================== --- trunk/examples/python/CMakeLists.txt 2009-05-23 19:53:06 UTC (rev 9993) +++ trunk/examples/python/CMakeLists.txt 2009-05-23 20:22:17 UTC (rev 9994) @@ -186,3 +186,9 @@ DESTINATION ${DATA_DIR}/examples/python PERMISSIONS ${PERM_DATA} ) + +install(FILES CMakeLists.txt_installed_examples_python + DESTINATION ${DATA_DIR}/examples/python + RENAME CMakeLists.txt + ) + Added: trunk/examples/python/CMakeLists.txt_installed_examples_python =================================================================== --- trunk/examples/python/CMakeLists.txt_installed_examples_python (rev 0) +++ trunk/examples/python/CMakeLists.txt_installed_examples_python 2009-05-23 20:22:17 UTC (rev 9994) @@ -0,0 +1,129 @@ +# python/CMakeLists.txt for installed PLplot examples +### Process this file with cmake to produce Makefile +### +# Copyright (C) 2009 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 + +# N.B. examples 14 and 17 handled independently. +set(python_STRING_INDICES +"01" +"02" +"03" +"04" +"05" +"06" +"07" +"08" +"09" +"10" +"11" +"12" +"13" +"15" +"16" +"18" +"19" +"20" +"21" +"22" +"23" +"24" +"25" +"26" +"27" +"28" +"29" +"30" +) + +set(python_SCRIPTS) +# Add some additional installed module files to list of what is normally +# copied to examples/python in the build tree. +set(python_DATA plplot_py_demos.py plplot_python_start.py) +foreach(STRING_INDEX ${python_STRING_INDICES}) + set(python_SCRIPTS ${python_SCRIPTS} x${STRING_INDEX}) + set(python_DATA ${python_DATA} xw${STRING_INDEX}.py) +endforeach(STRING_INDEX ${python_STRING_INDICES}) + +# This list contains standalone scripts which are executable and which +# should be copied to the installed examples build directory. +set( +python_SCRIPTS +${python_SCRIPTS} +pythondemos.py +x14 +x17 +x31 +prova.py +xw14.py +xw17.py +xw31.py +plplot_logo.py +test_circle.py +) + +if(ENABLE_pygcw) + set( + python_SCRIPTS + ${python_SCRIPTS} + plplotcanvas_demo.py + plplotcanvas_animation.py + ) +endif(ENABLE_pygcw) + +# This list contains python modules which are not executable on their own and +# data files that should be copied to the installed examples build tree. + +set( +python_DATA +${python_DATA} +README.pythondemos +README.logo +svg_760x120_gradient.patch +qplplot.py +) + +if(ENABLE_pygcw) + set( + python_DATA + ${python_DATA} + README.plplotcanvas + ) +endif(ENABLE_pygcw) + +if(NOT CMAKE_CURRENT_BINARY_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + # equivalent to install commands but at "make" time rather than + # "make install" time, to the build tree if different than the source + # tree. + set(command_depends) + foreach(file ${python_SCRIPTS} ${python_DATA}) + set( + command_DEPENDS + ${command_DEPENDS} + ${CMAKE_CURRENT_BINARY_DIR}/${file} + ) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${file} + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/${file} ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${file} + ) + endforeach(file ${python_SCRIPTS} ${python_DATA}) + add_custom_target(python_examples ALL DEPENDS ${command_DEPENDS}) + set_property(GLOBAL APPEND PROPERTY TARGETS_examples_python python_examples) +endif(NOT CMAKE_CURRENT_BINARY_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") + Property changes on: trunk/examples/python/CMakeLists.txt_installed_examples_python ___________________________________________________________________ Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |